home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 11 / AMUG BBS in a Box Volume XI (April 1994) (MacWizards).iso / Files / Prog / T / TIFF Code.sit / tiffio.c < prev    next >
MacBinary  |  1987-12-16  |  18.4 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: tiffio.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Dec 16 11:51:30 1987, modified Wed Dec 16 11:51:30 1987, creator 'MPS ', type ASCII, 17999 bytes "tiffio.c" , at 0x46cf 542 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 74 69 66 66 69 6f | 2e 63 00 00 00 00 00 00 |..tiffio|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 46 4f 00 | 00 02 1e 9d ec 6a 92 9d |.....FO.|.....j..|
|00000060| ec 6a 92 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.j......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 a2 0c 00 00 |........|........|
|00000080| 2f 2a 20 53 74 61 6e 64 | 61 72 64 20 43 20 49 6e |/* Stand|ard C In|
|00000090| 63 6c 75 64 65 20 66 69 | 6c 65 73 20 2a 2f 0d 2f |clude fi|les */./|
|000000a0| 2a 20 23 69 6e 63 6c 75 | 64 65 20 22 43 54 79 70 |* #inclu|de "CTyp|
|000000b0| 65 2e 68 22 20 2a 2f 0d | 2f 2a 20 23 69 6e 63 6c |e.h" */.|/* #incl|
|000000c0| 75 64 65 20 22 45 72 72 | 4e 6f 2e 68 22 20 2a 2f |ude "Err|No.h" */|
|000000d0| 0d 2f 2a 20 23 69 6e 63 | 6c 75 64 65 20 22 46 43 |./* #inc|lude "FC|
|000000e0| 6e 74 6c 2e 68 22 20 2a | 2f 0d 2f 2a 20 23 69 6e |ntl.h" *|/./* #in|
|000000f0| 63 6c 75 64 65 20 22 49 | 4f 43 74 6c 2e 68 22 20 |clude "I|OCtl.h" |
|00000100| 2a 2f 0d 2f 2a 20 23 69 | 6e 63 6c 75 64 65 20 22 |*/./* #i|nclude "|
|00000110| 4d 61 74 68 2e 68 22 20 | 2a 2f 0d 2f 2a 20 23 69 |Math.h" |*/./* #i|
|00000120| 6e 63 6c 75 64 65 20 22 | 53 65 74 4a 6d 70 2e 68 |nclude "|SetJmp.h|
|00000130| 22 20 2a 2f 0d 2f 2a 20 | 23 69 6e 63 6c 75 64 65 |" */./* |#include|
|00000140| 20 22 53 69 67 6e 61 6c | 2e 68 22 20 2a 2f 0d 2f | "Signal|.h" */./|
|00000150| 2a 20 23 69 6e 63 6c 75 | 64 65 20 22 53 74 64 49 |* #inclu|de "StdI|
|00000160| 4f 2e 68 22 20 2a 2f 0d | 2f 2a 20 23 69 6e 63 6c |O.h" */.|/* #incl|
|00000170| 75 64 65 20 22 53 74 72 | 69 6e 67 2e 68 22 20 2a |ude "Str|ing.h" *|
|00000180| 2f 0d 0d 2f 2a 20 50 72 | 69 6d 61 72 79 20 49 6e |/../* Pr|imary In|
|00000190| 74 65 72 66 61 63 65 20 | 46 69 6c 65 73 20 2a 2f |terface |Files */|
|000001a0| 0d 23 69 6e 63 6c 75 64 | 65 20 22 54 79 70 65 73 |.#includ|e "Types|
|000001b0| 2e 68 22 0d 2f 2a 20 23 | 69 6e 63 6c 75 64 65 20 |.h"./* #|include |
|000001c0| 22 52 65 73 6f 75 72 63 | 65 73 2e 68 22 20 2a 2f |"Resourc|es.h" */|
|000001d0| 0d 23 69 6e 63 6c 75 64 | 65 20 22 51 75 69 63 6b |.#includ|e "Quick|
|000001e0| 64 72 61 77 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |draw.h".|#include|
|000001f0| 20 22 57 69 6e 64 6f 77 | 73 2e 68 22 0d 2f 2a 20 | "Window|s.h"./* |
|00000200| 23 69 6e 63 6c 75 64 65 | 20 22 4f 53 55 74 69 6c |#include| "OSUtil|
|00000210| 73 2e 68 22 20 2a 2f 0d | 0d 2f 2a 20 43 6f 6d 6d |s.h" */.|./* Comm|
|00000220| 6f 6e 6c 79 20 49 6e 63 | 6c 75 64 65 64 20 66 69 |only Inc|luded fi|
|00000230| 6c 65 73 20 2a 2f 0d 2f | 2a 20 23 69 6e 63 6c 75 |les */./|* #inclu|
|00000240| 64 65 20 22 54 6f 6f 6c | 55 74 69 6c 73 2e 68 22 |de "Tool|Utils.h"|
|00000250| 20 2a 2f 0d 2f 2a 20 23 | 69 6e 63 6c 75 64 65 20 | */./* #|include |
|00000260| 22 54 65 78 74 45 64 69 | 74 2e 68 22 20 2a 2f 0d |"TextEdi|t.h" */.|
|00000270| 2f 2a 20 23 69 6e 63 6c | 75 64 65 20 22 43 6f 6e |/* #incl|ude "Con|
|00000280| 74 72 6f 6c 73 2e 68 22 | 20 2a 2f 0d 0d 2f 2a 20 |trols.h"| */../* |
|00000290| 4f 74 68 65 72 20 49 6e | 74 65 72 66 61 63 65 20 |Other In|terface |
|000002a0| 66 69 6c 65 73 20 2a 2f | 0d 2f 2a 20 23 69 6e 63 |files */|./* #inc|
|000002b0| 6c 75 64 65 20 22 41 70 | 70 6c 65 54 61 6c 6b 2e |lude "Ap|pleTalk.|
|000002c0| 68 22 20 2a 2f 0d 2f 2a | 20 23 69 6e 63 6c 75 64 |h" */./*| #includ|
|000002d0| 65 20 22 43 75 72 73 6f | 72 43 74 6c 2e 68 22 20 |e "Curso|rCtl.h" |
|000002e0| 2a 2f 0d 2f 2a 20 23 69 | 6e 63 6c 75 64 65 20 22 |*/./* #i|nclude "|
|000002f0| 44 65 73 6b 2e 68 22 20 | 2a 2f 0d 2f 2a 20 23 69 |Desk.h" |*/./* #i|
|00000300| 6e 63 6c 75 64 65 20 22 | 44 65 73 6b 42 75 73 2e |nclude "|DeskBus.|
|00000310| 68 22 20 2a 2f 0d 2f 2a | 20 23 69 6e 63 6c 75 64 |h" */./*| #includ|
|00000320| 65 20 22 44 65 76 69 63 | 65 73 2e 68 22 20 2a 2f |e "Devic|es.h" */|
|00000330| 0d 2f 2a 20 23 69 6e 63 | 6c 75 64 65 20 22 44 69 |./* #inc|lude "Di|
|00000340| 61 6c 6f 67 73 2e 68 22 | 20 2a 2f 0d 2f 2a 20 23 |alogs.h"| */./* #|
|00000350| 69 6e 63 6c 75 64 65 20 | 22 44 69 73 6b 49 6e 69 |include |"DiskIni|
|00000360| 74 2e 68 22 20 2a 2f 0d | 2f 2a 20 23 69 6e 63 6c |t.h" */.|/* #incl|
|00000370| 75 64 65 20 22 44 69 73 | 6b 73 2e 68 22 20 2a 2f |ude "Dis|ks.h" */|
|00000380| 0d 2f 2a 20 23 69 6e 63 | 6c 75 64 65 20 22 45 72 |./* #inc|lude "Er|
|00000390| 72 4d 67 72 2e 68 22 20 | 2a 2f 0d 23 69 6e 63 6c |rMgr.h" |*/.#incl|
|000003a0| 75 64 65 20 22 45 72 72 | 6f 72 73 2e 68 22 0d 2f |ude "Err|ors.h"./|
|000003b0| 2a 20 23 69 6e 63 6c 75 | 64 65 20 22 45 76 65 6e |* #inclu|de "Even|
|000003c0| 74 73 2e 68 22 20 2a 2f | 0d 23 69 6e 63 6c 75 64 |ts.h" */|.#includ|
|000003d0| 65 20 22 46 69 6c 65 73 | 2e 68 22 0d 2f 2a 20 23 |e "Files|.h"./* #|
|000003e0| 69 6e 63 6c 75 64 65 20 | 22 46 6f 6e 74 73 2e 68 |include |"Fonts.h|
|000003f0| 22 20 2a 2f 0d 2f 2a 20 | 23 69 6e 63 6c 75 64 65 |" */./* |#include|
|00000400| 20 22 47 72 61 66 33 44 | 2e 68 22 20 2a 2f 0d 2f | "Graf3D|.h" */./|
|00000410| 2a 20 23 69 6e 63 6c 75 | 64 65 20 22 4c 69 73 74 |* #inclu|de "List|
|00000420| 73 2e 68 22 20 2a 2f 0d | 23 69 6e 63 6c 75 64 65 |s.h" */.|#include|
|00000430| 20 22 4d 65 6d 6f 72 79 | 2e 68 22 0d 2f 2a 20 23 | "Memory|.h"./* #|
|00000440| 69 6e 63 6c 75 64 65 20 | 22 4d 65 6e 75 73 2e 68 |include |"Menus.h|
|00000450| 22 20 2a 2f 0d 23 69 6e | 63 6c 75 64 65 20 22 50 |" */.#in|clude "P|
|00000460| 61 63 6b 61 67 65 73 2e | 68 22 0d 2f 2a 20 23 69 |ackages.|h"./* #i|
|00000470| 6e 63 6c 75 64 65 20 22 | 50 61 6c 65 74 74 65 2e |nclude "|Palette.|
|00000480| 68 22 20 2a 2f 0d 2f 2a | 20 23 69 6e 63 6c 75 64 |h" */./*| #includ|
|00000490| 65 20 22 50 65 72 66 2e | 68 22 20 2a 2f 0d 2f 2a |e "Perf.|h" */./*|
|000004a0| 20 23 69 6e 63 6c 75 64 | 65 20 22 50 69 63 6b 65 | #includ|e "Picke|
|000004b0| 72 2e 68 22 20 2a 2f 0d | 2f 2a 20 23 69 6e 63 6c |r.h" */.|/* #incl|
|000004c0| 75 64 65 20 22 50 72 69 | 6e 74 69 6e 67 2e 68 22 |ude "Pri|nting.h"|
|000004d0| 20 2a 2f 0d 2f 2a 20 23 | 69 6e 63 6c 75 64 65 20 | */./* #|include |
|000004e0| 22 52 65 74 72 61 63 65 | 2e 68 22 20 2a 2f 0d 2f |"Retrace|.h" */./|
|000004f0| 2a 20 23 69 6e 63 6c 75 | 64 65 20 22 52 4f 4d 44 |* #inclu|de "ROMD|
|00000500| 65 66 73 2e 68 22 20 2a | 2f 0d 2f 2a 20 23 69 6e |efs.h" *|/./* #in|
|00000510| 63 6c 75 64 65 20 22 53 | 41 4e 45 2e 68 22 20 2a |clude "S|ANE.h" *|
|00000520| 2f 0d 23 69 6e 63 6c 75 | 64 65 20 22 53 63 72 61 |/.#inclu|de "Scra|
|00000530| 70 2e 68 22 0d 2f 2a 20 | 23 69 6e 63 6c 75 64 65 |p.h"./* |#include|
|00000540| 20 22 53 63 72 69 70 74 | 2e 68 22 20 2a 2f 0d 2f | "Script|.h" */./|
|00000550| 2a 20 23 69 6e 63 6c 75 | 64 65 20 22 53 43 53 49 |* #inclu|de "SCSI|
|00000560| 2e 68 22 20 2a 2f 0d 2f | 2a 20 23 69 6e 63 6c 75 |.h" */./|* #inclu|
|00000570| 64 65 20 22 53 65 67 4c | 6f 61 64 2e 68 22 20 2a |de "SegL|oad.h" *|
|00000580| 2f 0d 2f 2a 20 23 69 6e | 63 6c 75 64 65 20 22 53 |/./* #in|clude "S|
|00000590| 65 72 69 61 6c 2e 68 22 | 20 2a 2f 0d 2f 2a 20 23 |erial.h"| */./* #|
|000005a0| 69 6e 63 6c 75 64 65 20 | 22 53 6c 6f 74 73 2e 68 |include |"Slots.h|
|000005b0| 22 20 2a 2f 0d 2f 2a 20 | 23 69 6e 63 6c 75 64 65 |" */./* |#include|
|000005c0| 20 22 53 6f 75 6e 64 2e | 68 22 20 2a 2f 0d 2f 2a | "Sound.|h" */./*|
|000005d0| 20 23 69 6e 63 6c 75 64 | 65 20 22 53 74 61 72 74 | #includ|e "Start|
|000005e0| 2e 68 22 20 2a 2f 0d 2f | 2a 20 23 69 6e 63 6c 75 |.h" */./|* #inclu|
|000005f0| 64 65 20 22 53 74 72 69 | 6e 67 73 2e 68 22 20 2a |de "Stri|ngs.h" *|
|00000600| 2f 0d 2f 2a 20 23 69 6e | 63 6c 75 64 65 20 22 54 |/./* #in|clude "T|
|00000610| 69 6d 65 2e 68 22 20 2a | 2f 0d 2f 2a 20 23 69 6e |ime.h" *|/./* #in|
|00000620| 63 6c 75 64 65 20 22 54 | 72 61 70 73 2e 68 22 20 |clude "T|raps.h" |
|00000630| 2a 2f 0d 2f 2a 20 23 69 | 6e 63 6c 75 64 65 20 22 |*/./* #i|nclude "|
|00000640| 56 61 6c 75 65 73 2e 68 | 22 20 2a 2f 0d 2f 2a 20 |Values.h|" */./* |
|00000650| 23 69 6e 63 6c 75 64 65 | 20 22 56 61 72 41 72 67 |#include| "VarArg|
|00000660| 73 2e 68 22 20 2a 2f 0d | 2f 2a 20 23 69 6e 63 6c |s.h" */.|/* #incl|
|00000670| 75 64 65 20 22 56 69 64 | 65 6f 2e 68 22 20 2a 2f |ude "Vid|eo.h" */|
|00000680| 0d 0d 2f 2a 20 41 70 70 | 6c 69 63 61 74 69 6f 6e |../* App|lication|
|00000690| 2d 73 70 65 63 69 66 69 | 63 20 49 6e 63 6c 75 64 |-specifi|c Includ|
|000006a0| 65 20 66 69 6c 65 73 20 | 2a 2f 0d 23 69 6e 63 6c |e files |*/.#incl|
|000006b0| 75 64 65 20 22 3a 3a 54 | 69 66 66 4c 69 62 72 61 |ude "::T|iffLibra|
|000006c0| 72 79 3a 54 49 46 46 4c | 69 62 2e 68 22 0d 23 69 |ry:TIFFL|ib.h".#i|
|000006d0| 6e 63 6c 75 64 65 20 22 | 73 61 6d 70 6c 65 2e 68 |nclude "|sample.h|
|000006e0| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 6d 65 73 73 |".#inclu|de "mess|
|000006f0| 61 67 65 73 2e 68 22 0d | 0d 73 74 61 74 69 63 20 |ages.h".|.static |
|00000700| 50 74 72 09 53 65 74 49 | 44 50 74 72 28 29 3b 0d |Ptr.SetI|DPtr();.|
|00000710| 73 74 61 74 69 63 20 76 | 6f 69 64 09 43 6c 65 61 |static v|oid.Clea|
|00000720| 6e 55 70 28 29 3b 0d 73 | 74 61 74 69 63 20 76 6f |nUp();.s|tatic vo|
|00000730| 69 64 09 49 6e 69 74 49 | 44 28 29 3b 0d 0d 23 64 |id.InitI|D();..#d|
|00000740| 65 66 69 6e 65 09 4d 41 | 58 49 4d 41 47 45 53 49 |efine.MA|XIMAGESI|
|00000750| 5a 45 09 30 78 38 30 30 | 30 09 09 2f 2a 20 4c 69 |ZE.0x800|0../* Li|
|00000760| 6d 69 74 20 69 6d 61 67 | 65 73 20 74 6f 20 33 32 |mit imag|es to 32|
|00000770| 4b 20 66 6f 72 20 6e 6f | 77 20 2a 2f 0d 23 64 65 |K for no|w */.#de|
|00000780| 66 69 6e 65 09 49 4e 46 | 49 4e 49 54 59 09 09 30 |fine.INF|INITY..0|
|00000790| 78 34 30 30 30 30 30 30 | 09 2f 2a 20 54 49 46 46 |x4000000|./* TIFF|
|000007a0| 20 53 70 65 63 20 73 61 | 79 73 20 32 2a 2a 33 32 | Spec sa|ys 2**32|
|000007b0| 2d 31 20 62 75 74 20 74 | 68 69 73 20 69 73 20 62 |-1 but t|his is b|
|000007c0| 69 67 20 65 6e 6f 75 67 | 68 20 2a 2f 0d 0d 2f 2a |ig enoug|h */../*|
|000007d0| 0d 20 2a 20 52 65 61 64 | 20 69 6e 20 61 6e 20 69 |. * Read| in an i|
|000007e0| 6d 61 67 65 20 66 72 6f | 6d 20 61 20 54 49 46 46 |mage fro|m a TIFF|
|000007f0| 20 66 6f 72 6d 61 74 20 | 66 69 6c 65 2e 20 20 41 | format |file. A|
|00000800| 73 20 74 68 65 20 63 6f | 64 65 20 64 65 6d 6f 6e |s the co|de demon|
|00000810| 73 74 72 61 74 65 73 2c | 20 77 65 0d 20 2a 20 64 |strates,| we. * d|
|00000820| 6f 20 6e 6f 74 20 72 65 | 61 64 20 69 6e 20 76 65 |o not re|ad in ve|
|00000830| 72 79 20 63 6f 6d 70 6c | 69 63 61 74 65 64 20 69 |ry compl|icated i|
|00000840| 6d 61 67 65 73 2e 20 20 | 57 65 20 72 65 61 64 20 |mages. |We read |
|00000850| 69 6e 20 61 20 6e 75 6d | 62 65 72 20 6f 66 20 74 |in a num|ber of t|
|00000860| 61 67 73 2c 0d 20 2a 20 | 61 6e 64 20 72 65 6a 65 |ags,. * |and reje|
|00000870| 63 74 20 74 68 65 20 69 | 6d 61 67 65 20 61 73 20 |ct the i|mage as |
|00000880| 61 6e 20 75 6e 73 75 69 | 74 61 62 6c 65 20 74 69 |an unsui|table ti|
|00000890| 66 66 20 66 69 6c 65 20 | 69 66 20 61 6e 79 20 6f |ff file |if any o|
|000008a0| 66 20 73 65 76 65 72 61 | 6c 0d 20 2a 20 63 6f 6e |f severa|l. * con|
|000008b0| 64 69 74 69 6f 6e 73 20 | 65 78 69 73 74 2e 20 20 |ditions |exist. |
|000008c0| 57 65 20 64 6f 20 6e 6f | 74 20 72 65 61 64 20 69 |We do no|t read i|
|000008d0| 6e 20 69 6d 61 67 65 73 | 20 74 68 61 74 20 68 61 |n images| that ha|
|000008e0| 76 65 20 6d 6f 72 65 20 | 74 68 61 6e 20 6f 6e 65 |ve more |than one|
|000008f0| 20 62 69 74 0d 20 2a 20 | 6f 66 20 69 6d 61 67 65 | bit. * |of image|
|00000900| 20 64 61 74 61 20 70 65 | 72 20 70 69 78 65 6c 2e | data pe|r pixel.|
|00000910| 20 20 57 65 20 64 6f 20 | 6e 6f 74 20 73 63 61 6c | We do |not scal|
|00000920| 65 20 69 6d 61 67 65 73 | 2e 20 20 4f 66 20 74 68 |e images|. Of th|
|00000930| 6f 73 65 20 73 69 6d 70 | 6c 65 20 69 6d 61 67 65 |ose simp|le image|
|00000940| 73 0d 20 2a 20 74 68 61 | 74 20 77 65 20 64 6f 20 |s. * tha|t we do |
|00000950| 72 65 61 64 2c 20 77 65 | 20 77 69 6c 6c 20 6f 6e |read, we| will on|
|00000960| 6c 79 20 72 65 61 64 20 | 74 68 65 20 66 69 72 73 |ly read |the firs|
|00000970| 74 20 33 32 6b 20 6f 66 | 20 74 68 61 74 20 69 6d |t 32k of| that im|
|00000980| 61 67 65 2e 0d 20 2a 2f | 0d 42 6f 6f 6c 65 61 6e |age.. */|.Boolean|
|00000990| 20 52 65 61 64 54 69 66 | 66 28 72 65 66 4e 75 6d | ReadTif|f(refNum|
|000009a0| 2c 20 6d 79 42 69 74 4d | 61 70 50 74 72 29 0d 49 |, myBitM|apPtr).I|
|000009b0| 6e 74 31 36 20 72 65 66 | 4e 75 6d 3b 0d 42 69 74 |nt16 ref|Num;.Bit|
|000009c0| 4d 61 70 20 2a 6d 79 42 | 69 74 4d 61 70 50 74 72 |Map *myB|itMapPtr|
|000009d0| 3b 0d 7b 0d 09 48 61 6e | 64 6c 65 09 09 09 6c 69 |;.{..Han|dle...li|
|000009e0| 73 74 48 3b 0d 09 42 6f | 6f 6c 65 61 6e 09 09 09 |stH;..Bo|olean...|
|000009f0| 6f 64 64 52 6f 77 42 79 | 74 65 73 3b 0d 09 49 6e |oddRowBy|tes;..In|
|00000a00| 74 38 09 09 09 64 75 6d | 6d 79 3b 0d 09 49 6e 74 |t8...dum|my;..Int|
|00000a10| 31 36 09 09 09 62 79 74 | 65 4f 72 64 65 72 2c 0d |16...byt|eOrder,.|
|00000a20| 09 09 09 09 09 72 6f 77 | 42 79 74 65 73 2c 0d 09 |.....row|Bytes,..|
|00000a30| 09 09 09 09 73 63 72 6e | 48 52 65 73 2c 0d 09 09 |....scrn|HRes,...|
|00000a40| 09 09 09 73 63 72 6e 56 | 52 65 73 3b 0d 09 49 6e |...scrnV|Res;..In|
|00000a50| 74 33 32 09 09 09 74 61 | 67 4f 66 66 73 65 74 2c |t32...ta|gOffset,|
|00000a60| 0d 09 09 09 09 09 6e 65 | 78 74 44 69 72 4f 66 66 |......ne|xtDirOff|
|00000a70| 73 65 74 2c 0d 09 09 09 | 09 09 6e 65 78 74 46 69 |set,....|..nextFi|
|00000a80| 6c 65 46 72 65 65 2c 09 | 2f 2a 20 6e 65 78 74 20 |leFree,.|/* next |
|00000a90| 66 72 65 65 20 6c 6f 63 | 61 74 69 6f 6e 20 69 6e |free loc|ation in|
|00000aa0| 20 6f 75 74 70 75 74 20 | 66 69 6c 65 20 2a 2f 0d | output |file */.|
|00000ab0| 09 09 09 09 09 64 69 72 | 4f 66 66 73 65 74 2c 0d |.....dir|Offset,.|
|00000ac0| 09 09 09 09 09 72 6f 77 | 73 50 65 72 49 6d 61 67 |.....row|sPerImag|
|00000ad0| 65 2c 0d 09 09 09 09 09 | 63 6f 75 6e 74 2c 0d 09 |e,......|count,..|
|00000ae0| 09 09 09 09 73 69 7a 65 | 3b 0d 09 52 61 74 69 6f |....size|;..Ratio|
|00000af0| 6e 61 6c 09 09 78 52 65 | 73 2c 0d 09 09 09 09 09 |nal..xRe|s,......|
|00000b00| 79 52 65 73 3b 0d 09 52 | 65 63 74 09 09 09 69 6d |yRes;..R|ect...im|
|00000b10| 61 67 65 52 65 63 74 3b | 0d 09 54 69 66 66 44 69 |ageRect;|..TiffDi|
|00000b20| 72 45 6e 74 72 79 09 74 | 61 67 44 69 72 45 6e 74 |rEntry.t|agDirEnt|
|00000b30| 72 79 3b 0d 09 69 64 09 | 09 09 09 69 64 3b 09 09 |ry;..id.|...id;..|
|00000b40| 09 09 2f 2a 20 69 6d 61 | 67 65 20 64 65 73 63 72 |../* ima|ge descr|
|00000b50| 69 70 74 69 6f 6e 20 2a | 2f 0d 0d 09 49 6e 69 74 |iption *|/...Init|
|00000b60| 49 44 28 26 69 64 29 3b | 09 0d 09 53 63 72 65 65 |ID(&id);|...Scree|
|00000b70| 6e 52 65 73 28 26 73 63 | 72 6e 48 52 65 73 2c 20 |nRes(&sc|rnHRes, |
|00000b80| 26 73 63 72 6e 56 52 65 | 73 29 3b 09 2f 2a 20 69 |&scrnVRe|s);./* i|
|00000b90| 66 20 6e 65 65 64 65 64 | 20 66 6f 72 20 64 65 66 |f needed| for def|
|00000ba0| 61 75 6c 74 73 20 2a 2f | 0d 09 0d 09 2f 2a 0d 09 |aults */|..../*..|
|00000bb0| 20 2a 20 52 65 61 64 20 | 69 6e 20 68 65 61 64 65 | * Read |in heade|
|00000bc0| 72 20 61 6e 64 20 54 61 | 67 73 0d 09 20 2a 2f 0d |r and Ta|gs.. */.|
|00000bd0| 0d 09 69 66 20 28 54 52 | 65 61 64 48 65 61 64 65 |..if (TR|eadHeade|
|00000be0| 72 28 72 65 66 4e 75 6d | 2c 20 26 64 69 72 4f 66 |r(refNum|, &dirOf|
|00000bf0| 66 73 65 74 2c 20 26 62 | 79 74 65 4f 72 64 65 72 |fset, &b|yteOrder|
|00000c00| 29 20 21 3d 20 6e 6f 45 | 72 72 29 20 7b 0d 09 09 |) != noE|rr) {...|
|00000c10| 45 72 72 6f 72 4d 65 73 | 73 61 67 65 28 42 41 44 |ErrorMes|sage(BAD|
|00000c20| 52 45 41 44 48 45 41 44 | 45 52 29 3b 0d 09 09 72 |READHEAD|ER);...r|
|00000c30| 65 74 75 72 6e 28 66 61 | 6c 73 65 29 3b 0d 09 7d |eturn(fa|lse);..}|
|00000c40| 0d 0d 09 69 66 28 54 52 | 65 61 64 54 61 67 73 28 |...if(TR|eadTags(|
|00000c50| 72 65 66 4e 75 6d 2c 20 | 62 79 74 65 4f 72 64 65 |refNum, |byteOrde|
|00000c60| 72 2c 0d 09 09 09 09 26 | 6c 69 73 74 48 2c 20 64 |r,.....&|listH, d|
|00000c70| 69 72 4f 66 66 73 65 74 | 2c 20 26 6e 65 78 74 44 |irOffset|, &nextD|
|00000c80| 69 72 4f 66 66 73 65 74 | 29 20 21 3d 20 6e 6f 45 |irOffset|) != noE|
|00000c90| 72 72 29 20 7b 0d 09 09 | 45 72 72 6f 72 4d 65 73 |rr) {...|ErrorMes|
|00000ca0| 73 61 67 65 28 42 41 44 | 52 45 41 44 54 41 47 53 |sage(BAD|READTAGS|
|00000cb0| 29 3b 0d 09 09 72 65 74 | 75 72 6e 28 66 61 6c 73 |);...ret|urn(fals|
|00000cc0| 65 29 3b 0d 09 7d 0d 09 | 0d 09 2f 2a 0d 09 20 2a |e);..}..|../*.. *|
|00000cd0| 20 47 65 74 20 74 61 67 | 73 20 76 61 6c 75 65 73 | Get tag|s values|
|00000ce0| 2e 0d 09 20 2a 2f 0d 09 | 2f 2a 20 53 55 42 46 49 |... */..|/* SUBFI|
|00000cf0| 4c 45 5f 54 59 50 45 5f | 54 41 47 20 2a 2f 0d 09 |LE_TYPE_|TAG */..|
|00000d00| 69 66 20 28 54 46 69 6e | 64 54 61 67 28 6c 69 73 |if (TFin|dTag(lis|
|00000d10| 74 48 2c 20 26 74 61 67 | 4f 66 66 73 65 74 2c 20 |tH, &tag|Offset, |
|00000d20| 53 55 42 46 49 4c 45 5f | 54 59 50 45 5f 54 41 47 |SUBFILE_|TYPE_TAG|
|00000d30| 29 29 0d 09 09 54 47 65 | 74 54 61 67 28 6c 69 73 |))...TGe|tTag(lis|
|00000d40| 74 48 2c 20 74 61 67 4f | 66 66 73 65 74 2c 20 26 |tH, tagO|ffset, &|
|00000d50| 69 64 2e 73 75 62 66 69 | 6c 65 54 79 70 65 2c 20 |id.subfi|leType, |
|00000d60| 73 69 7a 65 6f 66 28 69 | 64 2e 73 75 62 66 69 6c |sizeof(i|d.subfil|
|00000d70| 65 54 79 70 65 29 29 3b | 0d 09 65 6c 73 65 20 7b |eType));|..else {|
|00000d80| 0d 09 09 45 72 72 6f 72 | 4d 65 73 73 61 67 65 28 |...Error|Message(|
|00000d90| 42 41 44 54 49 46 46 29 | 3b 0d 09 09 43 6c 65 61 |BADTIFF)|;...Clea|
|00000da0| 6e 55 70 28 6c 69 73 74 | 48 2c 20 26 69 64 29 3b |nUp(list|H, &id);|
|00000db0| 0d 09 09 72 65 74 75 72 | 6e 28 66 61 6c 73 65 29 |...retur|n(false)|
|00000dc0| 3b 0d 09 7d 0d 09 2f 2a | 20 49 4d 41 47 45 5f 57 |;..}../*| IMAGE_W|
|00000dd0| 49 44 54 48 5f 54 41 47 | 20 2a 2f 0d 09 69 66 20 |IDTH_TAG| */..if |
|00000de0| 28 54 46 69 6e 64 54 61 | 67 28 6c 69 73 74 48 2c |(TFindTa|g(listH,|
|00000df0| 20 26 74 61 67 4f 66 66 | 73 65 74 2c 20 49 4d 41 | &tagOff|set, IMA|
|00000e00| 47 45 5f 57 49 44 54 48 | 5f 54 41 47 29 29 0d 09 |GE_WIDTH|_TAG))..|
|00000e10| 09 54 47 65 74 54 61 67 | 28 6c 69 73 74 48 2c 20 |.TGetTag|(listH, |
|00000e20| 74 61 67 4f 66 66 73 65 | 74 2c 20 26 69 64 2e 69 |tagOffse|t, &id.i|
|00000e30| 6d 61 67 65 57 69 64 74 | 68 2c 20 73 69 7a 65 6f |mageWidt|h, sizeo|
|00000e40| 66 28 69 64 2e 69 6d 61 | 67 65 57 69 64 74 68 29 |f(id.ima|geWidth)|
|00000e50| 29 3b 0d 09 65 6c 73 65 | 20 7b 0d 09 09 45 72 72 |);..else| {...Err|
|00000e60| 6f 72 4d 65 73 73 61 67 | 65 28 42 41 44 54 49 46 |orMessag|e(BADTIF|
|00000e70| 46 29 3b 0d 09 09 43 6c | 65 61 6e 55 70 28 6c 69 |F);...Cl|eanUp(li|
|00000e80| 73 74 48 2c 20 26 69 64 | 29 3b 0d 09 09 72 65 74 |stH, &id|);...ret|
|00000e90| 75 72 6e 28 66 61 6c 73 | 65 29 3b 0d 09 7d 0d 09 |urn(fals|e);..}..|
|00000ea0| 2f 2a 20 49 4d 41 47 45 | 5f 4c 45 4e 47 54 48 5f |/* IMAGE|_LENGTH_|
|00000eb0| 54 41 47 20 2a 2f 0d 09 | 69 66 20 28 54 46 69 6e |TAG */..|if (TFin|
|00000ec0| 64 54 61 67 28 6c 69 73 | 74 48 2c 20 26 74 61 67 |dTag(lis|tH, &tag|
|00000ed0| 4f 66 66 73 65 74 2c 20 | 49 4d 41 47 45 5f 4c 45 |Offset, |IMAGE_LE|
|00000ee0| 4e 47 54 48 5f 54 41 47 | 29 29 0d 09 09 54 47 65 |NGTH_TAG|))...TGe|
|00000ef0| 74 54 61 67 28 6c 69 73 | 74 48 2c 20 74 61 67 4f |tTag(lis|tH, tagO|
|00000f00| 66 66 73 65 74 2c 20 26 | 69 64 2e 69 6d 61 67 65 |ffset, &|id.image|
|00000f10| 4c 65 6e 67 74 68 2c 20 | 73 69 7a 65 6f 66 28 69 |Length, |sizeof(i|
|00000f20| 64 2e 69 6d 61 67 65 4c | 65 6e 67 74 68 29 29 3b |d.imageL|ength));|
|00000f30| 0d 09 65 6c 73 65 20 7b | 0d 09 09 45 72 72 6f 72 |..else {|...Error|
|00000f40| 4d 65 73 73 61 67 65 28 | 42 41 44 54 49 46 46 29 |Message(|BADTIFF)|
|00000f50| 3b 0d 09 09 43 6c 65 61 | 6e 55 70 28 6c 69 73 74 |;...Clea|nUp(list|
|00000f60| 48 2c 20 26 69 64 29 3b | 0d 09 09 72 65 74 75 72 |H, &id);|...retur|
|00000f70| 6e 28 66 61 6c 73 65 29 | 3b 0d 09 7d 0d 09 2f 2a |n(false)|;..}../*|
|00000f80| 20 52 4f 57 53 5f 50 45 | 52 5f 53 54 52 49 50 5f | ROWS_PE|R_STRIP_|
|00000f90| 54 41 47 20 2a 2f 0d 09 | 69 66 20 28 54 46 69 6e |TAG */..|if (TFin|
|00000fa0| 64 54 61 67 28 6c 69 73 | 74 48 2c 20 26 74 61 67 |dTag(lis|tH, &tag|
|00000fb0| 4f 66 66 73 65 74 2c 20 | 52 4f 57 53 5f 50 45 52 |Offset, |ROWS_PER|
|00000fc0| 5f 53 54 52 49 50 5f 54 | 41 47 29 29 20 7b 0d 09 |_STRIP_T|AG)) {..|
|00000fd0| 09 54 47 65 74 54 61 67 | 28 6c 69 73 74 48 2c 20 |.TGetTag|(listH, |
|00000fe0| 74 61 67 4f 66 66 73 65 | 74 2c 20 26 69 64 2e 72 |tagOffse|t, &id.r|
|00000ff0| 6f 77 73 50 65 72 53 74 | 72 69 70 2c 20 73 69 7a |owsPerSt|rip, siz|
|00001000| 65 6f 66 28 69 64 2e 72 | 6f 77 73 50 65 72 53 74 |eof(id.r|owsPerSt|
|00001010| 72 69 70 29 29 3b 0d 09 | 09 74 61 67 44 69 72 45 |rip));..|.tagDirE|
|00001020| 6e 74 72 79 20 3d 20 47 | 65 74 44 69 72 45 6e 74 |ntry = G|etDirEnt|
|00001030| 72 79 28 6c 69 73 74 48 | 2c 20 74 61 67 4f 66 66 |ry(listH|, tagOff|
|00001040| 73 65 74 29 3b 0d 09 09 | 73 77 69 74 63 68 28 74 |set);...|switch(t|
|00001050| 61 67 44 69 72 45 6e 74 | 72 79 2e 74 79 70 65 29 |agDirEnt|ry.type)|
|00001060| 20 7b 0d 09 09 63 61 73 | 65 20 4c 4f 4e 47 3a 0d | {...cas|e LONG:.|
|00001070| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 63 61 73 65 |...break|;...case|
|00001080| 20 53 48 4f 52 54 3a 09 | 2f 2a 20 6f 6b 2c 20 62 | SHORT:.|/* ok, b|
|00001090| 75 74 20 63 6f 6e 76 65 | 72 74 20 72 65 74 75 72 |ut conve|rt retur|
|000010a0| 6e 65 64 20 76 61 6c 75 | 65 20 2a 2f 0d 09 09 09 |ned valu|e */....|
|000010b0| 69 64 2e 72 6f 77 73 50 | 65 72 53 74 72 69 70 20 |id.rowsP|erStrip |
|000010c0| 3d 20 28 6c 6f 6e 67 29 | 28 20 2a 28 28 49 6e 74 |= (long)|( *((Int|
|000010d0| 31 36 20 2a 29 28 26 69 | 64 2e 72 6f 77 73 50 65 |16 *)(&i|d.rowsPe|
|000010e0| 72 53 74 72 69 70 29 29 | 20 29 3b 0d 09 09 09 62 |rStrip))| );....b|
|000010f0| 72 65 61 6b 3b 0d 09 09 | 64 65 66 61 75 6c 74 3a |reak;...|default:|
|00001100| 0d 09 09 09 45 72 72 6f | 72 4d 65 73 73 61 67 65 |....Erro|rMessage|
|00001110| 28 42 41 44 54 49 46 46 | 29 3b 0d 09 09 09 43 6c |(BADTIFF|);....Cl|
|00001120| 65 61 6e 55 70 28 6c 69 | 73 74 48 2c 20 26 69 64 |eanUp(li|stH, &id|
|00001130| 29 3b 0d 09 09 09 72 65 | 74 75 72 6e 28 66 61 6c |);....re|turn(fal|
|00001140| 73 65 29 3b 0d 09 09 7d | 0d 09 7d 0d 09 65 6c 73 |se);...}|..}..els|
|00001150| 65 20 7b 0d 09 09 69 64 | 2e 72 6f 77 73 50 65 72 |e {...id|.rowsPer|
|00001160| 53 74 72 69 70 20 3d 20 | 49 4e 46 49 4e 49 54 59 |Strip = |INFINITY|
|00001170| 3b 0d 09 7d 0d 09 2f 2a | 20 53 41 4d 50 4c 45 53 |;..}../*| SAMPLES|
|00001180| 5f 50 45 52 5f 50 49 58 | 45 4c 5f 54 41 47 20 2a |_PER_PIX|EL_TAG *|
|00001190| 2f 0d 09 69 66 20 28 54 | 46 69 6e 64 54 61 67 28 |/..if (T|FindTag(|
|000011a0| 6c 69 73 74 48 2c 20 26 | 74 61 67 4f 66 66 73 65 |listH, &|tagOffse|
|000011b0| 74 2c 20 53 41 4d 50 4c | 45 53 5f 50 45 52 5f 50 |t, SAMPL|ES_PER_P|
|000011c0| 49 58 45 4c 5f 54 41 47 | 29 29 0d 09 09 54 47 65 |IXEL_TAG|))...TGe|
|000011d0| 74 54 61 67 28 6c 69 73 | 74 48 2c 20 74 61 67 4f |tTag(lis|tH, tagO|
|000011e0| 66 66 73 65 74 2c 20 26 | 69 64 2e 73 61 6d 70 6c |ffset, &|id.sampl|
|000011f0| 65 73 50 65 72 50 69 78 | 65 6c 2c 20 73 69 7a 65 |esPerPix|el, size|
|00001200| 6f 66 28 69 64 2e 73 61 | 6d 70 6c 65 73 50 65 72 |of(id.sa|mplesPer|
|00001210| 50 69 78 65 6c 29 29 3b | 0d 09 65 6c 73 65 20 7b |Pixel));|..else {|
|00001220| 0d 09 09 69 64 2e 73 61 | 6d 70 6c 65 73 50 65 72 |...id.sa|mplesPer|
|00001230| 50 69 78 65 6c 20 3d 20 | 31 3b 0d 09 7d 0d 09 2f |Pixel = |1;..}../|
|00001240| 2a 20 42 49 54 53 5f 50 | 45 52 5f 53 41 4d 50 4c |* BITS_P|ER_SAMPL|
|00001250| 45 5f 54 41 47 20 2a 2f | 0d 09 69 64 2e 62 69 74 |E_TAG */|..id.bit|
|00001260| 73 50 65 72 53 61 6d 70 | 6c 65 20 3d 20 53 65 74 |sPerSamp|le = Set|
|00001270| 49 44 50 74 72 28 6c 69 | 73 74 48 2c 20 42 49 54 |IDPtr(li|stH, BIT|
|00001280| 53 5f 50 45 52 5f 53 41 | 4d 50 4c 45 5f 54 41 47 |S_PER_SA|MPLE_TAG|
|00001290| 2c 20 31 4c 2c 20 53 48 | 4f 52 54 29 3b 0d 09 69 |, 1L, SH|ORT);..i|
|000012a0| 66 20 28 69 64 2e 62 69 | 74 73 50 65 72 53 61 6d |f (id.bi|tsPerSam|
|000012b0| 70 6c 65 20 3d 3d 20 6e | 69 6c 29 20 7b 0d 09 09 |ple == n|il) {...|
|000012c0| 09 43 6c 65 61 6e 55 70 | 28 6c 69 73 74 48 2c 20 |.CleanUp|(listH, |
|000012d0| 26 69 64 29 3b 0d 09 09 | 09 72 65 74 75 72 6e 28 |&id);...|.return(|
|000012e0| 66 61 6c 73 65 29 3b 0d | 09 7d 0d 09 2f 2a 20 50 |false);.|.}../* P|
|000012f0| 4c 41 4e 41 52 5f 43 4f | 4e 46 49 47 5f 54 41 47 |LANAR_CO|NFIG_TAG|
|00001300| 20 2a 2f 0d 09 69 66 20 | 28 54 46 69 6e 64 54 61 | */..if |(TFindTa|
|00001310| 67 28 6c 69 73 74 48 2c | 20 26 74 61 67 4f 66 66 |g(listH,| &tagOff|
|00001320| 73 65 74 2c 20 50 4c 41 | 4e 41 52 5f 43 4f 4e 46 |set, PLA|NAR_CONF|
|00001330| 49 47 5f 54 41 47 29 29 | 0d 09 09 54 47 65 74 54 |IG_TAG))|...TGetT|
|00001340| 61 67 28 6c 69 73 74 48 | 2c 20 74 61 67 4f 66 66 |ag(listH|, tagOff|
|00001350| 73 65 74 2c 20 26 69 64 | 2e 70 6c 61 6e 61 72 43 |set, &id|.planarC|
|00001360| 6f 6e 66 69 67 2c 20 73 | 69 7a 65 6f 66 28 69 64 |onfig, s|izeof(id|
|00001370| 2e 70 6c 61 6e 61 72 43 | 6f 6e 66 69 67 29 29 3b |.planarC|onfig));|
|00001380| 0d 09 65 6c 73 65 0d 09 | 09 69 64 2e 70 6c 61 6e |..else..|.id.plan|
|00001390| 61 72 43 6f 6e 66 69 67 | 20 3d 20 31 3b 0d 09 2f |arConfig| = 1;../|
|000013a0| 2a 20 43 4f 4d 50 52 45 | 53 53 49 4f 4e 5f 54 41 |* COMPRE|SSION_TA|
|000013b0| 47 20 2a 2f 0d 09 69 64 | 2e 63 6f 6d 70 72 65 73 |G */..id|.compres|
|000013c0| 73 69 6f 6e 20 3d 20 53 | 65 74 49 44 50 74 72 28 |sion = S|etIDPtr(|
|000013d0| 6c 69 73 74 48 2c 20 43 | 4f 4d 50 52 45 53 53 49 |listH, C|OMPRESSI|
|000013e0| 4f 4e 5f 54 41 47 2c 20 | 31 4c 2c 20 53 48 4f 52 |ON_TAG, |1L, SHOR|
|000013f0| 54 29 3b 0d 09 69 66 20 | 28 69 64 2e 63 6f 6d 70 |T);..if |(id.comp|
|00001400| 72 65 73 73 69 6f 6e 20 | 3d 3d 20 6e 69 6c 29 20 |ression |== nil) |
|00001410| 7b 0d 09 09 09 43 6c 65 | 61 6e 55 70 28 6c 69 73 |{....Cle|anUp(lis|
|00001420| 74 48 2c 20 26 69 64 29 | 3b 0d 09 09 09 72 65 74 |tH, &id)|;....ret|
|00001430| 75 72 6e 28 66 61 6c 73 | 65 29 3b 0d 09 7d 0d 09 |urn(fals|e);..}..|
|00001440| 2f 2a 20 4d 49 4e 5f 53 | 41 4d 50 4c 45 5f 56 41 |/* MIN_S|AMPLE_VA|
|00001450| 4c 55 45 5f 54 41 47 20 | 2a 2f 0d 09 69 64 2e 6d |LUE_TAG |*/..id.m|
|00001460| 69 6e 53 61 6d 70 6c 65 | 56 61 6c 75 65 20 3d 20 |inSample|Value = |
|00001470| 53 65 74 49 44 50 74 72 | 28 6c 69 73 74 48 2c 20 |SetIDPtr|(listH, |
|00001480| 4d 49 4e 5f 53 41 4d 50 | 4c 45 5f 56 41 4c 55 45 |MIN_SAMP|LE_VALUE|
|00001490| 5f 54 41 47 2c 20 30 4c | 2c 20 53 48 4f 52 54 29 |_TAG, 0L|, SHORT)|
|000014a0| 3b 0d 09 69 66 20 28 69 | 64 2e 6d 69 6e 53 61 6d |;..if (i|d.minSam|
|000014b0| 70 6c 65 56 61 6c 75 65 | 20 3d 3d 20 6e 69 6c 29 |pleValue| == nil)|
|000014c0| 20 7b 0d 09 09 09 43 6c | 65 61 6e 55 70 28 6c 69 | {....Cl|eanUp(li|
|000014d0| 73 74 48 2c 20 26 69 64 | 29 3b 0d 09 09 09 72 65 |stH, &id|);....re|
|000014e0| 74 75 72 6e 28 66 61 6c | 73 65 29 3b 0d 09 7d 0d |turn(fal|se);..}.|
|000014f0| 09 2f 2a 20 4d 41 58 5f | 53 41 4d 50 4c 45 5f 56 |./* MAX_|SAMPLE_V|
|00001500| 41 4c 55 45 5f 54 41 47 | 20 2a 2f 0d 09 69 64 2e |ALUE_TAG| */..id.|
|00001510| 6d 61 78 53 61 6d 70 6c | 65 56 61 6c 75 65 20 3d |maxSampl|eValue =|
|00001520| 20 53 65 74 49 44 50 74 | 72 28 6c 69 73 74 48 2c | SetIDPt|r(listH,|
|00001530| 20 4d 41 58 5f 53 41 4d | 50 4c 45 5f 56 41 4c 55 | MAX_SAM|PLE_VALU|
|00001540| 45 5f 54 41 47 2c 0d 09 | 09 09 09 09 09 09 28 49 |E_TAG,..|......(I|
|00001550| 6e 74 33 32 29 28 28 31 | 20 3c 3c 20 2a 69 64 2e |nt32)((1| << *id.|
|00001560| 62 69 74 73 50 65 72 53 | 61 6d 70 6c 65 29 20 2d |bitsPerS|ample) -|
|00001570| 20 31 29 2c 20 53 48 4f | 52 54 29 3b 0d 09 69 66 | 1), SHO|RT);..if|
|00001580| 20 28 69 64 2e 6d 61 78 | 53 61 6d 70 6c 65 56 61 | (id.max|SampleVa|
|00001590| 6c 75 65 20 3d 3d 20 6e | 69 6c 29 20 7b 0d 09 09 |lue == n|il) {...|
|000015a0| 09 43 6c 65 61 6e 55 70 | 28 6c 69 73 74 48 2c 20 |.CleanUp|(listH, |
|000015b0| 26 69 64 29 3b 0d 09 09 | 09 72 65 74 75 72 6e 28 |&id);...|.return(|
|000015c0| 66 61 6c 73 65 29 3b 0d | 09 7d 0d 09 2f 2a 20 50 |false);.|.}../* P|
|000015d0| 48 4f 54 4f 4d 45 54 52 | 49 43 5f 49 4e 54 45 52 |HOTOMETR|IC_INTER|
|000015e0| 50 5f 54 41 47 20 2a 2f | 0d 09 69 66 20 28 54 46 |P_TAG */|..if (TF|
|000015f0| 69 6e 64 54 61 67 28 6c | 69 73 74 48 2c 20 26 74 |indTag(l|istH, &t|
|00001600| 61 67 4f 66 66 73 65 74 | 2c 20 50 48 4f 54 4f 4d |agOffset|, PHOTOM|
|00001610| 45 54 52 49 43 5f 49 4e | 54 45 52 50 5f 54 41 47 |ETRIC_IN|TERP_TAG|
|00001620| 29 29 0d 09 09 54 47 65 | 74 54 61 67 28 6c 69 73 |))...TGe|tTag(lis|
|00001630| 74 48 2c 20 74 61 67 4f | 66 66 73 65 74 2c 20 26 |tH, tagO|ffset, &|
|00001640| 69 64 2e 70 68 6f 74 6f | 49 6e 74 65 72 70 2c 20 |id.photo|Interp, |
|00001650| 73 69 7a 65 6f 66 28 69 | 64 2e 70 68 6f 74 6f 49 |sizeof(i|d.photoI|
|00001660| 6e 74 65 72 70 29 29 3b | 0d 09 65 6c 73 65 20 7b |nterp));|..else {|
|00001670| 0d 09 09 69 64 2e 70 68 | 6f 74 6f 49 6e 74 65 72 |...id.ph|otoInter|
|00001680| 70 20 3d 20 30 3b 09 2f | 2a 20 61 73 73 75 6d 65 |p = 0;./|* assume|
|00001690| 20 6d 61 63 20 70 68 6f | 74 6f 6d 65 74 72 69 63 | mac pho|tometric|
|000016a0| 20 69 6e 74 65 72 70 72 | 65 74 61 74 69 6f 6e 20 | interpr|etation |
|000016b0| 2a 2f 0d 09 7d 0d 09 2f | 2a 20 46 49 4c 4c 5f 4f |*/..}../|* FILL_O|
|000016c0| 52 44 45 52 5f 54 41 47 | 20 2a 2f 0d 09 69 66 20 |RDER_TAG| */..if |
|000016d0| 28 54 46 69 6e 64 54 61 | 67 28 6c 69 73 74 48 2c |(TFindTa|g(listH,|
|000016e0| 20 26 74 61 67 4f 66 66 | 73 65 74 2c 20 46 49 4c | &tagOff|set, FIL|
|000016f0| 4c 5f 4f 52 44 45 52 5f | 54 41 47 29 29 0d 09 09 |L_ORDER_|TAG))...|
|00001700| 54 47 65 74 54 61 67 28 | 6c 69 73 74 48 2c 20 74 |TGetTag(|listH, t|
|00001710| 61 67 4f 66 66 73 65 74 | 2c 20 26 69 64 2e 66 69 |agOffset|, &id.fi|
|00001720| 6c 6c 4f 72 64 65 72 2c | 20 73 69 7a 65 6f 66 28 |llOrder,| sizeof(|
|00001730| 69 64 2e 66 69 6c 6c 4f | 72 64 65 72 29 29 3b 0d |id.fillO|rder));.|
|00001740| 09 65 6c 73 65 0d 09 09 | 69 64 2e 66 69 6c 6c 4f |.else...|id.fillO|
|00001750| 72 64 65 72 20 3d 20 31 | 3b 0d 09 2f 2a 20 4f 52 |rder = 1|;../* OR|
|00001760| 49 45 4e 54 41 54 49 4f | 4e 5f 54 41 47 20 2a 2f |IENTATIO|N_TAG */|
|00001770| 0d 09 69 66 20 28 54 46 | 69 6e 64 54 61 67 28 6c |..if (TF|indTag(l|
|00001780| 69 73 74 48 2c 20 26 74 | 61 67 4f 66 66 73 65 74 |istH, &t|agOffset|
|00001790| 2c 20 4f 52 49 45 4e 54 | 41 54 49 4f 4e 5f 54 41 |, ORIENT|ATION_TA|
|000017a0| 47 29 29 0d 09 09 54 47 | 65 74 54 61 67 28 6c 69 |G))...TG|etTag(li|
|000017b0| 73 74 48 2c 20 74 61 67 | 4f 66 66 73 65 74 2c 20 |stH, tag|Offset, |
|000017c0| 26 69 64 2e 6f 72 69 65 | 6e 74 61 74 69 6f 6e 2c |&id.orie|ntation,|
|000017d0| 20 73 69 7a 65 6f 66 28 | 69 64 2e 6f 72 69 65 6e | sizeof(|id.orien|
|000017e0| 74 61 74 69 6f 6e 29 29 | 3b 0d 09 65 6c 73 65 0d |tation))|;..else.|
|000017f0| 09 09 69 64 2e 6f 72 69 | 65 6e 74 61 74 69 6f 6e |..id.ori|entation|
|00001800| 20 3d 20 31 3b 0d 09 2f | 2a 20 58 5f 52 45 53 4f | = 1;../|* X_RESO|
|00001810| 4c 55 54 49 4f 4e 5f 54 | 41 47 20 2a 2f 0d 09 69 |LUTION_T|AG */..i|
|00001820| 66 20 28 54 46 69 6e 64 | 54 61 67 28 6c 69 73 74 |f (TFind|Tag(list|
|00001830| 48 2c 20 26 74 61 67 4f | 66 66 73 65 74 2c 20 58 |H, &tagO|ffset, X|
|00001840| 5f 52 45 53 4f 4c 55 54 | 49 4f 4e 5f 54 41 47 29 |_RESOLUT|ION_TAG)|
|00001850| 29 0d 09 09 54 47 65 74 | 54 61 67 28 6c 69 73 74 |)...TGet|Tag(list|
|00001860| 48 2c 20 74 61 67 4f 66 | 66 73 65 74 2c 20 26 69 |H, tagOf|fset, &i|
|00001870| 64 2e 78 52 65 73 6f 6c | 75 74 69 6f 6e 2c 20 73 |d.xResol|ution, s|
|00001880| 69 7a 65 6f 66 28 69 64 | 2e 78 52 65 73 6f 6c 75 |izeof(id|.xResolu|
|00001890| 74 69 6f 6e 29 29 3b 0d | 09 65 6c 73 65 20 7b 0d |tion));.|.else {.|
|000018a0| 09 09 69 64 2e 78 52 65 | 73 6f 6c 75 74 69 6f 6e |..id.xRe|solution|
|000018b0| 2e 6e 75 6d 65 72 61 74 | 6f 72 20 3d 20 28 49 6e |.numerat|or = (In|
|000018c0| 74 33 32 29 73 63 72 6e | 48 52 65 73 3b 0d 09 09 |t32)scrn|HRes;...|
|000018d0| 69 64 2e 78 52 65 73 6f | 6c 75 74 69 6f 6e 2e 64 |id.xReso|lution.d|
|000018e0| 65 6e 6f 6d 69 6e 61 74 | 6f 72 20 3d 20 31 3b 0d |enominat|or = 1;.|
|000018f0| 09 7d 0d 09 2f 2a 20 59 | 5f 52 45 53 4f 4c 55 54 |.}../* Y|_RESOLUT|
|00001900| 49 4f 4e 5f 54 41 47 20 | 2a 2f 0d 09 69 66 20 28 |ION_TAG |*/..if (|
|00001910| 54 46 69 6e 64 54 61 67 | 28 6c 69 73 74 48 2c 20 |TFindTag|(listH, |
|00001920| 26 74 61 67 4f 66 66 73 | 65 74 2c 20 59 5f 52 45 |&tagOffs|et, Y_RE|
|00001930| 53 4f 4c 55 54 49 4f 4e | 5f 54 41 47 29 29 0d 09 |SOLUTION|_TAG))..|
|00001940| 09 54 47 65 74 54 61 67 | 28 6c 69 73 74 48 2c 20 |.TGetTag|(listH, |
|00001950| 74 61 67 4f 66 66 73 65 | 74 2c 20 26 69 64 2e 79 |tagOffse|t, &id.y|
|00001960| 52 65 73 6f 6c 75 74 69 | 6f 6e 2c 20 73 69 7a 65 |Resoluti|on, size|
|00001970| 6f 66 28 69 64 2e 79 52 | 65 73 6f 6c 75 74 69 6f |of(id.yR|esolutio|
|00001980| 6e 29 29 3b 0d 09 65 6c | 73 65 20 7b 0d 09 09 69 |n));..el|se {...i|
|00001990| 64 2e 79 52 65 73 6f 6c | 75 74 69 6f 6e 2e 6e 75 |d.yResol|ution.nu|
|000019a0| 6d 65 72 61 74 6f 72 20 | 3d 20 28 49 6e 74 33 32 |merator |= (Int32|
|000019b0| 29 73 63 72 6e 56 52 65 | 73 3b 0d 09 09 69 64 2e |)scrnVRe|s;...id.|
|000019c0| 79 52 65 73 6f 6c 75 74 | 69 6f 6e 2e 64 65 6e 6f |yResolut|ion.deno|
|000019d0| 6d 69 6e 61 74 6f 72 20 | 3d 20 31 3b 0d 09 7d 0d |minator |= 1;..}.|
|000019e0| 09 0d 09 2f 2a 0d 09 20 | 2a 20 49 6e 69 74 69 61 |.../*.. |* Initia|
|000019f0| 6c 69 7a 65 20 6f 66 20 | 6e 6f 6e 2d 74 61 67 20 |lize of |non-tag |
|00001a00| 76 61 6c 75 65 73 2e 0d | 09 20 2a 2f 0d 09 6f 64 |values..|. */..od|
|00001a10| 64 52 6f 77 42 79 74 65 | 73 20 3d 20 28 28 28 69 |dRowByte|s = (((i|
|00001a20| 64 2e 69 6d 61 67 65 57 | 69 64 74 68 20 2a 20 28 |d.imageW|idth * (|
|00001a30| 2a 69 64 2e 62 69 74 73 | 50 65 72 53 61 6d 70 6c |*id.bits|PerSampl|
|00001a40| 65 29 29 20 2b 20 37 29 | 20 2f 20 38 29 20 25 20 |e)) + 7)| / 8) % |
|00001a50| 32 20 21 3d 20 30 3b 0d | 09 69 64 2e 73 74 72 69 |2 != 0;.|.id.stri|
|00001a60| 70 73 50 65 72 49 6d 61 | 67 65 20 3d 0d 09 09 09 |psPerIma|ge =....|
|00001a70| 09 09 28 69 64 2e 69 6d | 61 67 65 4c 65 6e 67 74 |..(id.im|ageLengt|
|00001a80| 68 20 2b 20 69 64 2e 72 | 6f 77 73 50 65 72 53 74 |h + id.r|owsPerSt|
|00001a90| 72 69 70 20 2d 20 31 29 | 20 2f 20 69 64 2e 72 6f |rip - 1)| / id.ro|
|00001aa0| 77 73 50 65 72 53 74 72 | 69 70 3b 0d 0d 09 2f 2a |wsPerStr|ip;.../*|
|00001ab0| 0d 09 20 2a 09 43 68 65 | 63 6b 20 54 61 67 20 56 |.. *.Che|ck Tag V|
|00001ac0| 61 6c 75 65 73 20 74 6f | 20 73 65 65 20 69 66 20 |alues to| see if |
|00001ad0| 77 65 20 63 61 6e 20 72 | 65 61 64 20 74 68 69 73 |we can r|ead this|
|00001ae0| 20 54 49 46 46 20 66 69 | 6c 65 2e 0d 09 20 2a 09 | TIFF fi|le... *.|
|00001af0| 0d 09 20 2a 09 4e 4f 54 | 45 3a 20 41 6c 74 68 6f |.. *.NOT|E: Altho|
|00001b00| 75 67 68 20 74 68 65 20 | 6d 61 6a 6f 72 69 74 79 |ugh the |majority|
|00001b10| 20 6f 66 20 74 68 65 20 | 74 61 67 20 77 65 72 65 | of the |tag were|
|00001b20| 20 72 65 61 64 2c 20 61 | 6c 6c 20 74 68 65 20 76 | read, a|ll the v|
|00001b30| 61 6c 75 65 73 0d 09 20 | 2a 09 6f 62 74 61 69 6e |alues.. |*.obtain|
|00001b40| 65 64 20 61 72 65 20 6e | 6f 74 20 75 73 65 64 20 |ed are n|ot used |
|00001b50| 69 6e 20 64 69 73 70 6c | 61 79 69 6e 67 20 74 68 |in displ|aying th|
|00001b60| 65 20 69 6d 61 67 65 20 | 69 6e 20 54 48 49 53 20 |e image |in THIS |
|00001b70| 50 52 4f 47 52 41 4d 2e | 0d 09 20 2a 09 54 68 6f |PROGRAM.|.. *.Tho|
|00001b80| 73 65 20 6e 6f 74 20 75 | 73 65 64 20 77 65 72 65 |se not u|sed were|
|00001b90| 20 72 65 61 64 20 69 6e | 20 73 69 6d 70 6c 79 20 | read in| simply |
|00001ba0| 66 6f 72 20 74 6f 20 70 | 72 6f 76 69 64 65 20 74 |for to p|rovide t|
|00001bb0| 68 65 20 65 78 61 6d 70 | 6c 65 2e 0d 09 20 2a 2f |he examp|le... */|
|00001bc0| 0d 09 44 42 47 28 44 69 | 73 70 6c 61 79 49 44 28 |..DBG(Di|splayID(|
|00001bd0| 26 69 64 29 29 3b 09 20 | 0d 09 44 42 47 28 44 65 |&id));. |..DBG(De|
|00001be0| 62 75 67 4d 65 73 73 61 | 67 65 28 22 69 6d 61 67 |bugMessa|ge("imag|
|00001bf0| 65 20 72 6f 77 20 62 79 | 74 65 73 20 25 6c 64 22 |e row by|tes %ld"|
|00001c00| 2c 0d 09 09 28 28 69 64 | 2e 69 6d 61 67 65 57 69 |,...((id|.imageWi|
|00001c10| 64 74 68 20 2a 20 28 2a | 69 64 2e 62 69 74 73 50 |dth * (*|id.bitsP|
|00001c20| 65 72 53 61 6d 70 6c 65 | 20 2b 20 37 29 29 20 2f |erSample| + 7)) /|
|00001c30| 20 38 29 29 29 3b 0d 09 | 44 42 47 28 44 65 62 75 | 8)));..|DBG(Debu|
|00001c40| 67 4d 65 73 73 61 67 65 | 28 22 6f 64 64 52 6f 77 |gMessage|("oddRow|
|00001c50| 42 79 74 65 73 3d 25 73 | 22 2c 20 6f 64 64 52 6f |Bytes=%s|", oddRo|
|00001c60| 77 42 79 74 65 73 20 3f | 20 22 74 72 75 65 22 20 |wBytes ?| "true" |
|00001c70| 3a 20 22 66 61 6c 73 65 | 22 29 29 3b 0d 09 69 66 |: "false|"));..if|
|00001c80| 20 28 20 28 69 64 2e 73 | 61 6d 70 6c 65 73 50 65 | ( (id.s|amplesPe|
|00001c90| 72 50 69 78 65 6c 20 21 | 3d 20 31 29 09 09 09 09 |rPixel !|= 1)....|
|00001ca0| 09 09 7c 7c 0d 09 09 20 | 28 2a 69 64 2e 62 69 74 |..||... |(*id.bit|
|00001cb0| 73 50 65 72 53 61 6d 70 | 6c 65 20 21 3d 20 31 29 |sPerSamp|le != 1)|
|00001cc0| 09 09 09 09 09 09 7c 7c | 0d 09 09 20 28 69 64 2e |......|||... (id.|
|00001cd0| 70 6c 61 6e 61 72 43 6f | 6e 66 69 67 20 21 3d 20 |planarCo|nfig != |
|00001ce0| 31 20 26 26 20 69 64 2e | 70 6c 61 6e 61 72 43 6f |1 && id.|planarCo|
|00001cf0| 6e 66 69 67 20 21 3d 20 | 32 29 20 29 09 7b 0d 09 |nfig != |2) ).{..|
|00001d00| 09 45 72 72 6f 72 4d 65 | 73 73 61 67 65 28 42 41 |.ErrorMe|ssage(BA|
|00001d10| 44 54 49 46 46 29 3b 0d | 09 09 43 6c 65 61 6e 55 |DTIFF);.|..CleanU|
|00001d20| 70 28 6c 69 73 74 48 2c | 20 26 69 64 29 3b 0d 09 |p(listH,| &id);..|
|00001d30| 09 72 65 74 75 72 6e 28 | 66 61 6c 73 65 29 3b 0d |.return(|false);.|
|00001d40| 09 7d 0d 09 69 66 20 28 | 69 64 2e 70 68 6f 74 6f |.}..if (|id.photo|
|00001d50| 49 6e 74 65 72 70 20 21 | 3d 20 30 29 09 2f 2a 20 |Interp !|= 0)./* |
|00001d60| 57 65 20 64 6f 6e 27 74 | 20 74 72 61 6e 73 6c 61 |We don't| transla|
|00001d70| 74 65 20 79 65 74 20 73 | 6f 20 6c 65 74 20 27 65 |te yet s|o let 'e|
|00001d80| 6d 20 6b 6e 6f 77 20 2a | 2f 0d 09 09 45 72 72 6f |m know *|/...Erro|
|00001d90| 72 4d 65 73 73 61 67 65 | 28 42 41 44 50 48 4f 54 |rMessage|(BADPHOT|
|00001da0| 4f 49 4e 54 45 52 50 29 | 3b 0d 09 09 0d 09 72 6f |OINTERP)|;.....ro|
|00001db0| 77 42 79 74 65 73 20 3d | 20 28 28 28 69 64 2e 69 |wBytes =| (((id.i|
|00001dc0| 6d 61 67 65 57 69 64 74 | 68 20 2d 20 31 29 20 2f |mageWidt|h - 1) /|
|00001dd0| 20 28 32 20 2a 20 38 29 | 29 20 2b 20 31 29 20 2a | (2 * 8)|) + 1) *|
|00001de0| 20 32 3b 0d 09 2f 2a 20 | 6f 6e 6c 79 20 6d 61 6b | 2;../* |only mak|
|00001df0| 65 20 69 6d 61 67 65 20 | 61 73 20 6d 75 63 68 20 |e image |as much |
|00001e00| 61 73 20 77 69 6c 6c 20 | 66 69 74 20 69 6e 20 4d |as will |fit in M|
|00001e10| 41 58 49 4d 41 47 45 53 | 49 5a 45 20 66 6f 72 20 |AXIMAGES|IZE for |
|00001e20| 6e 6f 77 20 2a 2f 0d 09 | 73 69 7a 65 20 3d 20 69 |now */..|size = i|
|00001e30| 64 2e 69 6d 61 67 65 4c | 65 6e 67 74 68 20 2a 20 |d.imageL|ength * |
|00001e40| 72 6f 77 42 79 74 65 73 | 3b 0d 09 69 66 20 28 73 |rowBytes|;..if (s|
|00001e50| 69 7a 65 20 3e 20 4d 41 | 58 49 4d 41 47 45 53 49 |ize > MA|XIMAGESI|
|00001e60| 5a 45 29 20 7b 0d 09 09 | 45 72 72 6f 72 4d 65 73 |ZE) {...|ErrorMes|
|00001e70| 73 61 67 65 28 49 4d 41 | 47 45 43 52 4f 50 57 41 |sage(IMA|GECROPWA|
|00001e80| 52 4e 29 3b 0d 09 09 73 | 69 7a 65 20 3d 20 4d 41 |RN);...s|ize = MA|
|00001e90| 58 49 4d 41 47 45 53 49 | 5a 45 3b 0d 09 7d 0d 09 |XIMAGESI|ZE;..}..|
|00001ea0| 72 6f 77 73 50 65 72 49 | 6d 61 67 65 20 3d 20 73 |rowsPerI|mage = s|
|00001eb0| 69 7a 65 20 2f 20 72 6f | 77 42 79 74 65 73 3b 0d |ize / ro|wBytes;.|
|00001ec0| 0d 09 2f 2a 0d 09 20 2a | 20 50 72 65 70 61 72 65 |../*.. *| Prepare|
|00001ed0| 20 62 69 74 6d 61 70 2e | 0d 09 20 2a 2f 0d 09 69 | bitmap.|.. */..i|
|00001ee0| 66 20 28 6d 79 42 69 74 | 4d 61 70 50 74 72 2d 3e |f (myBit|MapPtr->|
|00001ef0| 62 61 73 65 41 64 64 72 | 20 21 3d 20 6e 69 6c 29 |baseAddr| != nil)|
|00001f00| 0d 09 09 44 69 73 70 6f | 73 50 74 72 28 6d 79 42 |...Dispo|sPtr(myB|
|00001f10| 69 74 4d 61 70 50 74 72 | 2d 3e 62 61 73 65 41 64 |itMapPtr|->baseAd|
|00001f20| 64 72 29 3b 0d 09 69 66 | 20 28 28 6d 79 42 69 74 |dr);..if| ((myBit|
|00001f30| 4d 61 70 50 74 72 2d 3e | 62 61 73 65 41 64 64 72 |MapPtr->|baseAddr|
|00001f40| 20 3d 20 4d 79 4e 65 77 | 50 74 72 28 73 69 7a 65 | = MyNew|Ptr(size|
|00001f50| 29 29 20 3d 3d 20 6e 69 | 6c 29 20 7b 0d 09 09 43 |)) == ni|l) {...C|
|00001f60| 6c 65 61 6e 55 70 28 6c | 69 73 74 48 2c 20 26 69 |leanUp(l|istH, &i|
|00001f70| 64 29 3b 0d 09 09 72 65 | 74 75 72 6e 28 66 61 6c |d);...re|turn(fal|
|00001f80| 73 65 29 3b 0d 09 7d 0d | 09 6d 79 42 69 74 4d 61 |se);..}.|.myBitMa|
|00001f90| 70 50 74 72 2d 3e 72 6f | 77 42 79 74 65 73 20 3d |pPtr->ro|wBytes =|
|00001fa0| 20 72 6f 77 42 79 74 65 | 73 3b 0d 09 6d 79 42 69 | rowByte|s;..myBi|
|00001fb0| 74 4d 61 70 50 74 72 2d | 3e 62 6f 75 6e 64 73 2e |tMapPtr-|>bounds.|
|00001fc0| 74 6f 70 20 3d 20 30 3b | 0d 09 6d 79 42 69 74 4d |top = 0;|..myBitM|
|00001fd0| 61 70 50 74 72 2d 3e 62 | 6f 75 6e 64 73 2e 6c 65 |apPtr->b|ounds.le|
|00001fe0| 66 74 20 3d 20 30 3b 0d | 09 6d 79 42 69 74 4d 61 |ft = 0;.|.myBitMa|
|00001ff0| 70 50 74 72 2d 3e 62 6f | 75 6e 64 73 2e 62 6f 74 |pPtr->bo|unds.bot|
|00002000| 74 6f 6d 20 3d 20 72 6f | 77 73 50 65 72 49 6d 61 |tom = ro|wsPerIma|
|00002010| 67 65 3b 0d 09 6d 79 42 | 69 74 4d 61 70 50 74 72 |ge;..myB|itMapPtr|
|00002020| 2d 3e 62 6f 75 6e 64 73 | 2e 72 69 67 68 74 20 3d |->bounds|.right =|
|00002030| 20 69 64 2e 69 6d 61 67 | 65 57 69 64 74 68 3b 0d | id.imag|eWidth;.|
|00002040| 0d 09 20 0d 09 2f 2a 0d | 09 20 2a 20 52 65 61 64 |.. ../*.|. * Read|
|00002050| 20 69 6e 20 69 6d 61 67 | 65 2e 0d 09 20 2a 2f 0d | in imag|e... */.|
|00002060| 09 44 42 47 28 44 65 62 | 75 67 4d 65 73 73 61 67 |.DBG(Deb|ugMessag|
|00002070| 65 28 22 72 6f 77 73 50 | 65 72 49 6d 61 67 65 3d |e("rowsP|erImage=|
|00002080| 25 6c 64 22 2c 72 6f 77 | 73 50 65 72 49 6d 61 67 |%ld",row|sPerImag|
|00002090| 65 29 29 3b 0d 09 69 66 | 20 28 54 52 65 61 64 49 |e));..if| (TReadI|
|000020a0| 6d 61 67 65 28 72 65 66 | 4e 75 6d 2c 20 6c 69 73 |mage(ref|Num, lis|
|000020b0| 74 48 2c 0d 09 09 09 09 | 09 30 4c 2c 20 6d 79 42 |tH,.....|.0L, myB|
|000020c0| 69 74 4d 61 70 50 74 72 | 2d 3e 62 61 73 65 41 64 |itMapPtr|->baseAd|
|000020d0| 64 72 2c 20 72 6f 77 73 | 50 65 72 49 6d 61 67 65 |dr, rows|PerImage|
|000020e0| 2c 20 2d 31 29 20 21 3d | 20 6e 6f 45 72 72 29 20 |, -1) !=| noErr) |
|000020f0| 7b 0d 09 09 43 6c 65 61 | 6e 55 70 28 6c 69 73 74 |{...Clea|nUp(list|
|00002100| 48 2c 20 26 69 64 29 3b | 09 09 09 09 09 09 0d 09 |H, &id);|........|
|00002110| 09 72 65 74 75 72 6e 28 | 66 61 6c 73 65 29 3b 0d |.return(|false);.|
|00002120| 09 7d 0d 09 69 66 20 28 | 6f 64 64 52 6f 77 42 79 |.}..if (|oddRowBy|
|00002130| 74 65 73 29 0d 09 09 54 | 46 69 78 4f 64 64 52 6f |tes)...T|FixOddRo|
|00002140| 77 42 79 74 65 73 28 6d | 79 42 69 74 4d 61 70 50 |wBytes(m|yBitMapP|
|00002150| 74 72 29 3b 0d 09 44 69 | 73 70 6c 61 79 49 6d 61 |tr);..Di|splayIma|
|00002160| 67 65 28 46 72 6f 6e 74 | 57 69 6e 64 6f 77 28 29 |ge(Front|Window()|
|00002170| 2c 20 6d 79 42 69 74 4d | 61 70 50 74 72 29 3b 0d |, myBitM|apPtr);.|
|00002180| 0d 09 43 6c 65 61 6e 55 | 70 28 6c 69 73 74 48 2c |..CleanU|p(listH,|
|00002190| 20 26 69 64 29 3b 09 09 | 09 09 09 09 0d 09 72 65 | &id);..|......re|
|000021a0| 74 75 72 6e 28 74 72 75 | 65 29 3b 0d 7d 0d 0d 76 |turn(tru|e);.}..v|
|000021b0| 6f 69 64 20 57 72 69 74 | 65 54 69 66 66 28 72 65 |oid Writ|eTiff(re|
|000021c0| 66 4e 75 6d 2c 20 6d 79 | 42 69 74 4d 61 70 50 74 |fNum, my|BitMapPt|
|000021d0| 72 29 0d 49 6e 74 31 36 | 20 72 65 66 4e 75 6d 3b |r).Int16| refNum;|
|000021e0| 0d 42 69 74 4d 61 70 20 | 2a 6d 79 42 69 74 4d 61 |.BitMap |*myBitMa|
|000021f0| 70 50 74 72 3b 0d 7b 0d | 09 48 61 6e 64 6c 65 09 |pPtr;.{.|.Handle.|
|00002200| 09 6c 69 73 74 48 3b 0d | 09 50 74 72 09 09 09 62 |.listH;.|.Ptr...b|
|00002210| 75 66 66 65 72 50 74 72 | 3b 0d 09 42 6f 6f 6c 65 |ufferPtr|;..Boole|
|00002220| 61 6e 09 09 6f 64 64 52 | 6f 77 42 79 74 65 73 3b |an..oddR|owBytes;|
|00002230| 0d 09 49 6e 74 38 09 09 | 64 75 6d 6d 79 3b 0d 09 |..Int8..|dummy;..|
|00002240| 49 6e 74 31 36 09 09 62 | 79 74 65 4f 72 64 65 72 |Int16..b|yteOrder|
|00002250| 2c 0d 09 09 09 09 73 75 | 62 66 69 6c 65 54 79 70 |,.....su|bfileTyp|
|00002260| 65 2c 0d 09 09 09 09 69 | 6d 61 67 65 57 69 64 74 |e,.....i|mageWidt|
|00002270| 68 2c 0d 09 09 09 09 69 | 6d 61 67 65 4c 65 6e 67 |h,.....i|mageLeng|
|00002280| 74 68 2c 0d 09 09 09 09 | 66 69 6c 6c 4f 72 64 65 |th,.....|fillOrde|
|00002290| 72 2c 0d 09 09 09 09 63 | 6f 6d 70 72 65 73 73 54 |r,.....c|ompressT|
|000022a0| 79 70 65 2c 0d 09 09 09 | 09 70 68 6f 74 6f 49 6e |ype,....|.photoIn|
|000022b0| 74 65 72 70 2c 0d 09 09 | 09 09 62 69 74 73 50 65 |terp,...|..bitsPe|
|000022c0| 72 50 69 78 65 6c 2c 0d | 09 09 09 09 6d 69 6e 53 |rPixel,.|....minS|
|000022d0| 61 6d 70 6c 65 56 61 6c | 75 65 2c 0d 09 09 09 09 |ampleVal|ue,.....|
|000022e0| 6d 61 78 53 61 6d 70 6c | 65 56 61 6c 75 65 2c 0d |maxSampl|eValue,.|
|000022f0| 09 09 09 09 6f 72 69 65 | 6e 74 61 74 69 6f 6e 2c |....orie|ntation,|
|00002300| 0d 09 09 09 09 74 69 66 | 66 52 6f 77 42 79 74 65 |.....tif|fRowByte|
|00002310| 73 2c 09 2f 2a 20 6e 75 | 6d 62 65 72 20 6f 66 20 |s,./* nu|mber of |
|00002320| 62 79 74 65 73 20 70 65 | 72 20 72 6f 77 20 69 6e |bytes pe|r row in|
|00002330| 20 54 49 46 46 20 66 6f | 72 6d 61 74 20 2a 2f 0d | TIFF fo|rmat */.|
|00002340| 09 09 09 09 70 6c 61 6e | 65 2c 09 09 09 2f 2a 20 |....plan|e,.../* |
|00002350| 64 75 6d 6d 79 20 70 61 | 72 61 6d 65 74 65 72 20 |dummy pa|rameter |
|00002360| 66 6f 72 20 54 57 72 69 | 74 65 49 6d 61 67 65 53 |for TWri|teImageS|
|00002370| 74 72 69 70 20 2a 2f 0d | 09 09 09 09 73 63 72 6e |trip */.|....scrn|
|00002380| 48 52 65 73 2c 0d 09 09 | 09 09 73 63 72 6e 56 52 |HRes,...|..scrnVR|
|00002390| 65 73 3b 0d 09 49 6e 74 | 33 32 09 09 72 6f 77 73 |es;..Int|32..rows|
|000023a0| 50 65 72 53 74 72 69 70 | 2c 0d 09 09 09 09 6e 65 |PerStrip|,.....ne|
|000023b0| 78 74 46 69 6c 65 46 72 | 65 65 2c 09 2f 2a 20 6e |xtFileFr|ee,./* n|
|000023c0| 65 78 74 20 66 72 65 65 | 20 6c 6f 63 61 74 69 6f |ext free| locatio|
|000023d0| 6e 20 69 6e 20 6f 75 74 | 70 75 74 20 66 69 6c 65 |n in out|put file|
|000023e0| 20 2a 2f 0d 09 09 09 09 | 73 74 61 72 74 4c 69 6e | */.....|startLin|
|000023f0| 65 2c 0d 09 09 09 09 6e | 75 6d 4c 69 6e 65 73 2c |e,.....n|umLines,|
|00002400| 0d 09 09 09 09 64 69 72 | 4f 66 66 73 65 74 2c 0d |.....dir|Offset,.|
|00002410| 09 09 09 09 63 6f 75 6e | 74 3b 0d 09 52 61 74 69 |....coun|t;..Rati|
|00002420| 6f 6e 61 6c 09 78 52 65 | 73 2c 0d 09 09 09 09 79 |onal.xRe|s,.....y|
|00002430| 52 65 73 3b 0d 09 52 65 | 63 74 09 09 69 6d 61 67 |Res;..Re|ct..imag|
|00002440| 65 52 65 63 74 3b 0d 09 | 0d 09 2f 2a 20 67 65 74 |eRect;..|../* get|
|00002450| 20 61 20 68 61 6e 64 6c | 65 20 66 6f 72 20 74 68 | a handl|e for th|
|00002460| 65 20 69 6e 20 6d 65 6d | 6f 72 79 20 74 61 67 20 |e in mem|ory tag |
|00002470| 6c 69 73 74 20 2a 2f 0d | 09 6c 69 73 74 48 20 3d |list */.|.listH =|
|00002480| 20 4e 65 77 48 61 6e 64 | 6c 65 28 30 29 3b 0d 09 | NewHand|le(0);..|
|00002490| 69 66 20 28 4d 65 6d 45 | 72 72 6f 72 28 29 20 21 |if (MemE|rror() !|
|000024a0| 3d 20 6e 6f 45 72 72 29 | 20 7b 0d 09 09 45 72 72 |= noErr)| {...Err|
|000024b0| 6f 72 4d 65 73 73 61 67 | 65 28 42 41 44 4d 45 4d |orMessag|e(BADMEM|
|000024c0| 4f 52 59 29 3b 0d 09 09 | 72 65 74 75 72 6e 3b 0d |ORY);...|return;.|
|000024d0| 09 7d 0d 0d 09 53 63 72 | 65 65 6e 52 65 73 28 26 |.}...Scr|eenRes(&|
|000024e0| 73 63 72 6e 48 52 65 73 | 2c 20 26 73 63 72 6e 56 |scrnHRes|, &scrnV|
|000024f0| 52 65 73 29 3b 0d 09 69 | 6d 61 67 65 52 65 63 74 |Res);..i|mageRect|
|00002500| 20 3d 20 6d 79 42 69 74 | 4d 61 70 50 74 72 2d 3e | = myBit|MapPtr->|
|00002510| 62 6f 75 6e 64 73 3b 0d | 09 2f 2a 20 77 72 69 74 |bounds;.|./* writ|
|00002520| 65 20 6f 75 74 20 38 20 | 72 6f 77 73 20 70 65 72 |e out 8 |rows per|
|00002530| 20 73 74 72 69 70 20 2d | 20 38 20 69 73 20 61 6e | strip -| 8 is an|
|00002540| 20 61 72 62 69 74 72 61 | 72 79 20 6e 75 6d 62 65 | arbitra|ry numbe|
|00002550| 72 20 2a 2f 0d 09 72 6f | 77 73 50 65 72 53 74 72 |r */..ro|wsPerStr|
|00002560| 69 70 20 3d 20 4d 49 4e | 28 69 6d 61 67 65 52 65 |ip = MIN|(imageRe|
|00002570| 63 74 2e 62 6f 74 74 6f | 6d 20 2d 20 69 6d 61 67 |ct.botto|m - imag|
|00002580| 65 52 65 63 74 2e 74 6f | 70 2c 20 38 29 3b 0d 0d |eRect.to|p, 8);..|
|00002590| 09 2f 2a 20 69 6e 69 74 | 69 61 6c 69 7a 65 20 74 |./* init|ialize t|
|000025a0| 61 67 20 76 61 6c 75 65 | 73 20 2a 2f 0d 09 62 79 |ag value|s */..by|
|000025b0| 74 65 4f 72 64 65 72 20 | 3d 20 4d 4f 54 4f 52 4f |teOrder |= MOTORO|
|000025c0| 4c 41 3b 0d 09 73 75 62 | 66 69 6c 65 54 79 70 65 |LA;..sub|fileType|
|000025d0| 20 3d 20 31 3b 0d 09 69 | 6d 61 67 65 57 69 64 74 | = 1;..i|mageWidt|
|000025e0| 68 20 3d 20 69 6d 61 67 | 65 52 65 63 74 2e 72 69 |h = imag|eRect.ri|
|000025f0| 67 68 74 3b 0d 09 69 6d | 61 67 65 4c 65 6e 67 74 |ght;..im|ageLengt|
|00002600| 68 20 3d 20 69 6d 61 67 | 65 52 65 63 74 2e 62 6f |h = imag|eRect.bo|
|00002610| 74 74 6f 6d 3b 0d 09 62 | 69 74 73 50 65 72 50 69 |ttom;..b|itsPerPi|
|00002620| 78 65 6c 20 3d 20 31 3b | 0d 09 66 69 6c 6c 4f 72 |xel = 1;|..fillOr|
|00002630| 64 65 72 20 3d 20 31 3b | 0d 09 63 6f 6d 70 72 65 |der = 1;|..compre|
|00002640| 73 73 54 79 70 65 20 3d | 20 31 3b 0d 09 70 68 6f |ssType =| 1;..pho|
|00002650| 74 6f 49 6e 74 65 72 70 | 20 3d 20 30 3b 0d 09 6d |toInterp| = 0;..m|
|00002660| 69 6e 53 61 6d 70 6c 65 | 56 61 6c 75 65 20 3d 20 |inSample|Value = |
|00002670| 30 3b 0d 09 6d 61 78 53 | 61 6d 70 6c 65 56 61 6c |0;..maxS|ampleVal|
|00002680| 75 65 20 3d 20 28 31 20 | 3c 3c 20 62 69 74 73 50 |ue = (1 |<< bitsP|
|00002690| 65 72 50 69 78 65 6c 29 | 20 2d 20 31 3b 0d 09 6f |erPixel)| - 1;..o|
|000026a0| 72 69 65 6e 74 61 74 69 | 6f 6e 20 3d 20 31 3b 0d |rientati|on = 1;.|
|000026b0| 09 78 52 65 73 2e 6e 75 | 6d 65 72 61 74 6f 72 20 |.xRes.nu|merator |
|000026c0| 3d 20 28 49 6e 74 33 32 | 29 73 63 72 6e 48 52 65 |= (Int32|)scrnHRe|
|000026d0| 73 3b 0d 09 78 52 65 73 | 2e 64 65 6e 6f 6d 69 6e |s;..xRes|.denomin|
|000026e0| 61 74 6f 72 20 3d 20 31 | 3b 0d 09 79 52 65 73 2e |ator = 1|;..yRes.|
|000026f0| 6e 75 6d 65 72 61 74 6f | 72 20 3d 20 28 49 6e 74 |numerato|r = (Int|
|00002700| 33 32 29 73 63 72 6e 56 | 52 65 73 3b 0d 09 79 52 |32)scrnV|Res;..yR|
|00002710| 65 73 2e 64 65 6e 6f 6d | 69 6e 61 74 6f 72 20 3d |es.denom|inator =|
|00002720| 20 31 3b 0d 09 20 0d 09 | 74 69 66 66 52 6f 77 42 | 1;.. ..|tiffRowB|
|00002730| 79 74 65 73 20 3d 20 28 | 69 6d 61 67 65 52 65 63 |ytes = (|imageRec|
|00002740| 74 2e 72 69 67 68 74 20 | 2a 20 62 69 74 73 50 65 |t.right |* bitsPe|
|00002750| 72 50 69 78 65 6c 20 2b | 20 37 29 20 2f 20 38 3b |rPixel +| 7) / 8;|
|00002760| 0d 09 6f 64 64 52 6f 77 | 42 79 74 65 73 20 3d 20 |..oddRow|Bytes = |
|00002770| 28 74 69 66 66 52 6f 77 | 42 79 74 65 73 20 25 20 |(tiffRow|Bytes % |
|00002780| 32 29 20 21 3d 20 30 3b | 0d 09 44 42 47 28 44 65 |2) != 0;|..DBG(De|
|00002790| 62 75 67 4d 65 73 73 61 | 67 65 28 22 74 69 66 66 |bugMessa|ge("tiff|
|000027a0| 52 6f 77 42 79 74 65 73 | 3d 25 64 20 6f 64 64 52 |RowBytes|=%d oddR|
|000027b0| 6f 77 42 79 74 65 73 3d | 25 73 22 2c 0d 09 09 74 |owBytes=|%s",...t|
|000027c0| 69 66 66 52 6f 77 42 79 | 74 65 73 2c 20 6f 64 64 |iffRowBy|tes, odd|
|000027d0| 52 6f 77 42 79 74 65 73 | 20 3d 3d 20 66 61 6c 73 |RowBytes| == fals|
|000027e0| 65 20 3f 20 22 66 61 6c | 73 65 22 20 3a 20 22 74 |e ? "fal|se" : "t|
|000027f0| 72 75 65 22 29 29 3b 0d | 0d 09 2f 2a 0d 09 20 2a |rue"));.|../*.. *|
|00002800| 20 50 75 74 20 74 61 67 | 73 20 69 6e 20 6d 65 6d | Put tag|s in mem|
|00002810| 6f 72 79 20 6c 69 73 74 | 2e 0d 09 20 2a 20 54 68 |ory list|... * Th|
|00002820| 65 20 6f 72 64 65 72 20 | 74 61 67 73 20 61 72 65 |e order |tags are|
|00002830| 20 70 75 74 20 69 6e 20 | 74 68 65 20 6c 69 73 74 | put in |the list|
|00002840| 20 77 69 74 68 20 54 50 | 75 74 50 74 72 54 61 67 | with TP|utPtrTag|
|00002850| 20 69 73 20 4e 4f 54 20 | 69 6d 70 6f 72 74 61 6e | is NOT |importan|
|00002860| 74 2e 0d 09 20 2a 2f 0d | 09 69 66 20 28 09 54 50 |t... */.|.if (.TP|
|00002870| 75 74 50 74 72 54 61 67 | 28 6c 69 73 74 48 2c 20 |utPtrTag|(listH, |
|00002880| 53 55 42 46 49 4c 45 5f | 54 59 50 45 5f 54 41 47 |SUBFILE_|TYPE_TAG|
|00002890| 2c 20 53 48 4f 52 54 2c | 0d 09 09 09 09 09 09 09 |, SHORT,|........|
|000028a0| 09 09 31 4c 2c 09 26 73 | 75 62 66 69 6c 65 54 79 |..1L,.&s|ubfileTy|
|000028b0| 70 65 29 09 21 3d 20 6e | 6f 45 72 72 09 7c 7c 0d |pe).!= n|oErr.||.|
|000028c0| 09 09 09 54 50 75 74 50 | 74 72 54 61 67 28 6c 69 |...TPutP|trTag(li|
|000028d0| 73 74 48 2c 20 49 4d 41 | 47 45 5f 57 49 44 54 48 |stH, IMA|GE_WIDTH|
|000028e0| 5f 54 41 47 2c 09 53 48 | 4f 52 54 2c 0d 09 09 09 |_TAG,.SH|ORT,....|
|000028f0| 09 09 09 09 09 09 31 4c | 2c 20 26 69 6d 61 67 65 |......1L|, &image|
|00002900| 57 69 64 74 68 29 20 09 | 21 3d 20 6e 6f 45 72 72 |Width) .|!= noErr|
|00002910| 09 7c 7c 0d 09 09 09 54 | 50 75 74 50 74 72 54 61 |.||....T|PutPtrTa|
|00002920| 67 28 6c 69 73 74 48 2c | 20 49 4d 41 47 45 5f 4c |g(listH,| IMAGE_L|
|00002930| 45 4e 47 54 48 5f 54 41 | 47 2c 20 53 48 4f 52 54 |ENGTH_TA|G, SHORT|
|00002940| 2c 0d 09 09 09 09 09 09 | 09 09 09 31 4c 2c 20 26 |,.......|...1L, &|
|00002950| 69 6d 61 67 65 4c 65 6e | 67 74 68 29 09 21 3d 20 |imageLen|gth).!= |
|00002960| 6e 6f 45 72 72 09 7c 7c | 0d 09 09 09 54 50 75 74 |noErr.|||....TPut|
|00002970| 50 74 72 54 61 67 28 6c | 69 73 74 48 2c 20 52 4f |PtrTag(l|istH, RO|
|00002980| 57 53 5f 50 45 52 5f 53 | 54 52 49 50 5f 54 41 47 |WS_PER_S|TRIP_TAG|
|00002990| 2c 20 4c 4f 4e 47 2c 0d | 09 09 09 09 09 09 09 09 |, LONG,.|........|
|000029a0| 09 31 4c 2c 20 26 72 6f | 77 73 50 65 72 53 74 72 |.1L, &ro|wsPerStr|
|000029b0| 69 70 29 09 21 3d 20 6e | 6f 45 72 72 09 7c 7c 0d |ip).!= n|oErr.||.|
|000029c0| 09 09 09 54 50 75 74 50 | 74 72 54 61 67 28 6c 69 |...TPutP|trTag(li|
|000029d0| 73 74 48 2c 20 58 5f 52 | 45 53 4f 4c 55 54 49 4f |stH, X_R|ESOLUTIO|
|000029e0| 4e 5f 54 41 47 2c 20 52 | 41 54 49 4f 4e 41 4c 2c |N_TAG, R|ATIONAL,|
|000029f0| 0d 09 09 09 09 09 09 09 | 09 09 31 4c 2c 20 26 78 |........|..1L, &x|
|00002a00| 52 65 73 29 09 09 09 21 | 3d 20 6e 6f 45 72 72 09 |Res)...!|= noErr.|
|00002a10| 7c 7c 0d 09 09 09 54 50 | 75 74 50 74 72 54 61 67 |||....TP|utPtrTag|
|00002a20| 28 6c 69 73 74 48 2c 20 | 59 5f 52 45 53 4f 4c 55 |(listH, |Y_RESOLU|
|00002a30| 54 49 4f 4e 5f 54 41 47 | 2c 20 52 41 54 49 4f 4e |TION_TAG|, RATION|
|00002a40| 41 4c 2c 0d 09 09 09 09 | 09 09 09 09 09 31 4c 2c |AL,.....|.....1L,|
|00002a50| 20 26 79 52 65 73 29 09 | 09 09 21 3d 20 6e 6f 45 | &yRes).|..!= noE|
|00002a60| 72 72 09 7c 7c 0d 09 09 | 09 54 50 75 74 50 74 72 |rr.||...|.TPutPtr|
|00002a70| 54 61 67 28 6c 69 73 74 | 48 2c 20 42 49 54 53 5f |Tag(list|H, BITS_|
|00002a80| 50 45 52 5f 53 41 4d 50 | 4c 45 5f 54 41 47 2c 20 |PER_SAMP|LE_TAG, |
|00002a90| 53 48 4f 52 54 2c 0d 09 | 09 09 09 09 09 09 09 09 |SHORT,..|........|
|00002aa0| 31 4c 2c 26 62 69 74 73 | 50 65 72 50 69 78 65 6c |1L,&bits|PerPixel|
|00002ab0| 29 09 21 3d 20 6e 6f 45 | 72 72 09 7c 7c 0d 09 09 |).!= noE|rr.||...|
|00002ac0| 09 54 50 75 74 50 74 72 | 54 61 67 28 6c 69 73 74 |.TPutPtr|Tag(list|
|00002ad0| 48 2c 20 43 4f 4d 50 52 | 45 53 53 49 4f 4e 5f 54 |H, COMPR|ESSION_T|
|00002ae0| 41 47 2c 20 53 48 4f 52 | 54 2c 0d 09 09 09 09 09 |AG, SHOR|T,......|
|00002af0| 09 09 09 09 31 4c 2c 20 | 26 63 6f 6d 70 72 65 73 |....1L, |&compres|
|00002b00| 73 54 79 70 65 29 09 21 | 3d 20 6e 6f 45 72 72 09 |sType).!|= noErr.|
|00002b10| 7c 7c 0d 09 09 09 54 50 | 75 74 50 74 72 54 61 67 |||....TP|utPtrTag|
|00002b20| 28 6c 69 73 74 48 2c 20 | 46 49 4c 4c 5f 4f 52 44 |(listH, |FILL_ORD|
|00002b30| 45 52 5f 54 41 47 2c 20 | 53 48 4f 52 54 2c 0d 09 |ER_TAG, |SHORT,..|
|00002b40| 09 09 09 09 09 09 09 09 | 31 4c 2c 20 26 66 69 6c |........|1L, &fil|
|00002b50| 6c 4f 72 64 65 72 29 09 | 09 21 3d 20 6e 6f 45 72 |lOrder).|.!= noEr|
|00002b60| 72 09 7c 7c 0d 09 09 09 | 54 50 75 74 50 74 72 54 |r.||....|TPutPtrT|
|00002b70| 61 67 28 6c 69 73 74 48 | 2c 20 4f 52 49 45 4e 54 |ag(listH|, ORIENT|
|00002b80| 41 54 49 4f 4e 5f 54 41 | 47 2c 20 53 48 4f 52 54 |ATION_TA|G, SHORT|
|00002b90| 2c 0d 09 09 09 09 09 09 | 09 09 09 31 4c 2c 20 26 |,.......|...1L, &|
|00002ba0| 6f 72 69 65 6e 74 61 74 | 69 6f 6e 29 09 21 3d 20 |orientat|ion).!= |
|00002bb0| 6e 6f 45 72 72 09 7c 7c | 0d 09 09 09 54 50 75 74 |noErr.|||....TPut|
|00002bc0| 50 74 72 54 61 67 28 6c | 69 73 74 48 2c 20 50 48 |PtrTag(l|istH, PH|
|00002bd0| 4f 54 4f 4d 45 54 52 49 | 43 5f 49 4e 54 45 52 50 |OTOMETRI|C_INTERP|
|00002be0| 5f 54 41 47 2c 20 53 48 | 4f 52 54 2c 0d 09 09 09 |_TAG, SH|ORT,....|
|00002bf0| 09 09 09 09 09 09 31 4c | 2c 20 26 70 68 6f 74 6f |......1L|, &photo|
|00002c00| 49 6e 74 65 72 70 29 09 | 21 3d 20 6e 6f 45 72 72 |Interp).|!= noErr|
|00002c10| 09 29 20 7b 0d 09 09 45 | 72 72 6f 72 4d 65 73 73 |.) {...E|rrorMess|
|00002c20| 61 67 65 28 42 41 44 50 | 55 54 54 41 47 53 29 3b |age(BADP|UTTAGS);|
|00002c30| 0d 09 09 72 65 74 75 72 | 6e 3b 0d 09 7d 0d 09 0d |...retur|n;..}...|
|00002c40| 09 2f 2a 20 6c 65 61 76 | 65 20 72 6f 6f 6d 20 66 |./* leav|e room f|
|00002c50| 6f 72 20 68 65 61 64 65 | 72 20 69 6e 20 6f 75 74 |or heade|r in out|
|00002c60| 70 75 74 20 66 69 6c 65 | 20 2a 2f 0d 09 53 65 74 |put file| */..Set|
|00002c70| 45 4f 46 28 72 65 66 4e | 75 6d 2c 20 28 49 6e 74 |EOF(refN|um, (Int|
|00002c80| 33 32 29 73 69 7a 65 6f | 66 28 54 69 66 66 48 65 |32)sizeo|f(TiffHe|
|00002c90| 61 64 65 72 29 29 3b 0d | 09 6e 65 78 74 46 69 6c |ader));.|.nextFil|
|00002ca0| 65 46 72 65 65 20 3d 20 | 73 69 7a 65 6f 66 28 54 |eFree = |sizeof(T|
|00002cb0| 69 66 66 48 65 61 64 65 | 72 29 3b 0d 09 0d 09 2f |iffHeade|r);..../|
|00002cc0| 2a 0d 09 20 2a 20 57 72 | 69 74 65 20 6f 75 74 20 |*.. * Wr|ite out |
|00002cd0| 69 6d 61 67 65 20 74 6f | 20 66 69 6c 65 2c 20 66 |image to| file, f|
|00002ce0| 69 78 69 6e 67 20 66 72 | 6f 6d 20 4d 61 63 69 6e |ixing fr|om Macin|
|00002cf0| 74 6f 73 68 20 72 6f 75 | 6e 64 69 6e 67 20 6f 66 |tosh rou|nding of|
|00002d00| 20 72 6f 77 73 20 74 6f | 20 74 68 65 0d 09 20 2a | rows to| the.. *|
|00002d10| 20 6e 65 61 72 65 73 74 | 20 32 20 62 79 74 65 73 | nearest| 2 bytes|
|00002d20| 2c 20 74 6f 20 74 68 65 | 20 54 49 46 46 20 72 6f |, to the| TIFF ro|
|00002d30| 75 6e 64 69 6e 67 20 6f | 66 20 72 6f 77 73 20 74 |unding o|f rows t|
|00002d40| 6f 20 74 68 65 20 6e 65 | 61 72 65 73 74 20 62 79 |o the ne|arest by|
|00002d50| 74 65 2e 0d 09 20 2a 2f | 0d 09 69 66 20 28 6f 64 |te... */|..if (od|
|00002d60| 64 52 6f 77 42 79 74 65 | 73 29 0d 09 09 54 55 6e |dRowByte|s)...TUn|
|00002d70| 66 69 78 4f 64 64 52 6f | 77 42 79 74 65 73 28 6d |fixOddRo|wBytes(m|
|00002d80| 79 42 69 74 4d 61 70 50 | 74 72 29 3b 09 09 2f 2a |yBitMapP|tr);../*|
|00002d90| 20 72 6f 75 6e 64 20 72 | 6f 77 73 20 74 6f 20 6e | round r|ows to n|
|00002da0| 65 61 72 65 73 74 20 62 | 79 74 65 20 2a 2f 0d 0d |earest b|yte */..|
|00002db0| 09 73 74 61 72 74 4c 69 | 6e 65 20 3d 20 30 3b 0d |.startLi|ne = 0;.|
|00002dc0| 09 62 75 66 66 65 72 50 | 74 72 20 3d 20 6d 79 42 |.bufferP|tr = myB|
|00002dd0| 69 74 4d 61 70 50 74 72 | 2d 3e 62 61 73 65 41 64 |itMapPtr|->baseAd|
|00002de0| 64 72 3b 0d 09 77 68 69 | 6c 65 20 20 28 73 74 61 |dr;..whi|le (sta|
|00002df0| 72 74 4c 69 6e 65 20 3c | 20 69 6d 61 67 65 4c 65 |rtLine <| imageLe|
|00002e00| 6e 67 74 68 29 20 7b 0d | 09 09 6e 75 6d 4c 69 6e |ngth) {.|..numLin|
|00002e10| 65 73 20 3d 20 4d 49 4e | 28 69 6d 61 67 65 4c 65 |es = MIN|(imageLe|
|00002e20| 6e 67 74 68 20 2d 20 73 | 74 61 72 74 4c 69 6e 65 |ngth - s|tartLine|
|00002e30| 2c 20 72 6f 77 73 50 65 | 72 53 74 72 69 70 29 3b |, rowsPe|rStrip);|
|00002e40| 0d 09 09 69 66 20 28 54 | 57 72 69 74 65 49 6d 61 |...if (T|WriteIma|
|00002e50| 67 65 53 74 72 69 70 28 | 72 65 66 4e 75 6d 2c 20 |geStrip(|refNum, |
|00002e60| 26 6e 65 78 74 46 69 6c | 65 46 72 65 65 2c 20 6c |&nextFil|eFree, l|
|00002e70| 69 73 74 48 2c 0d 09 09 | 09 09 09 09 73 74 61 72 |istH,...|....star|
|00002e80| 74 4c 69 6e 65 2c 20 6e | 75 6d 4c 69 6e 65 73 2c |tLine, n|umLines,|
|00002e90| 20 62 75 66 66 65 72 50 | 74 72 2c 20 70 6c 61 6e | bufferP|tr, plan|
|00002ea0| 65 29 20 21 3d 20 6e 6f | 45 72 72 29 20 7b 0d 09 |e) != no|Err) {..|
|00002eb0| 09 09 45 72 72 6f 72 4d | 65 73 73 61 67 65 28 42 |..ErrorM|essage(B|
|00002ec0| 41 44 57 52 49 54 45 49 | 4d 41 47 45 29 3b 0d 09 |ADWRITEI|MAGE);..|
|00002ed0| 09 09 72 65 74 75 72 6e | 3b 0d 09 09 7d 0d 09 09 |..return|;...}...|
|00002ee0| 73 74 61 72 74 4c 69 6e | 65 20 2b 3d 20 6e 75 6d |startLin|e += num|
|00002ef0| 4c 69 6e 65 73 3b 0d 09 | 09 62 75 66 66 65 72 50 |Lines;..|.bufferP|
|00002f00| 74 72 20 2b 3d 20 6e 75 | 6d 4c 69 6e 65 73 20 2a |tr += nu|mLines *|
|00002f10| 20 74 69 66 66 52 6f 77 | 42 79 74 65 73 3b 0d 09 | tiffRow|Bytes;..|
|00002f20| 7d 0d 09 0d 09 69 66 20 | 28 6f 64 64 52 6f 77 42 |}....if |(oddRowB|
|00002f30| 79 74 65 73 29 0d 09 09 | 54 46 69 78 4f 64 64 52 |ytes)...|TFixOddR|
|00002f40| 6f 77 42 79 74 65 73 28 | 6d 79 42 69 74 4d 61 70 |owBytes(|myBitMap|
|00002f50| 50 74 72 29 3b 09 09 2f | 2a 20 72 6f 75 6e 64 20 |Ptr);../|* round |
|00002f60| 72 6f 77 73 20 74 6f 20 | 6e 65 61 72 65 73 74 20 |rows to |nearest |
|00002f70| 77 6f 72 64 20 2a 2f 0d | 0d 09 2f 2a 20 64 69 72 |word */.|../* dir|
|00002f80| 65 63 74 6f 72 79 20 6d | 75 73 74 20 62 65 20 6f |ectory m|ust be o|
|00002f90| 6e 20 77 6f 72 64 20 62 | 6f 75 6e 64 61 72 79 20 |n word b|oundary |
|00002fa0| 2a 2f 0d 09 69 66 20 28 | 6e 65 78 74 46 69 6c 65 |*/..if (|nextFile|
|00002fb0| 46 72 65 65 20 25 20 32 | 20 21 3d 20 30 29 20 7b |Free % 2| != 0) {|
|00002fc0| 0d 09 09 2f 2a 20 61 64 | 64 20 66 69 6c 6c 65 72 |.../* ad|d filler|
|00002fd0| 20 62 79 74 65 20 2a 2f | 0d 09 09 63 6f 75 6e 74 | byte */|...count|
|00002fe0| 20 3d 20 31 3b 0d 09 09 | 69 66 20 28 46 53 57 72 | = 1;...|if (FSWr|
|00002ff0| 69 74 65 28 72 65 66 4e | 75 6d 2c 20 26 63 6f 75 |ite(refN|um, &cou|
|00003000| 6e 74 2c 20 26 64 75 6d | 6d 79 29 20 21 3d 20 6e |nt, &dum|my) != n|
|00003010| 6f 45 72 72 29 20 7b 0d | 09 09 09 45 72 72 6f 72 |oErr) {.|...Error|
|00003020| 4d 65 73 73 61 67 65 28 | 42 41 44 57 52 49 54 45 |Message(|BADWRITE|
|00003030| 29 3b 0d 09 09 09 72 65 | 74 75 72 6e 3b 0d 09 09 |);....re|turn;...|
|00003040| 7d 0d 09 09 6e 65 78 74 | 46 69 6c 65 46 72 65 65 |}...next|FileFree|
|00003050| 2b 2b 3b 0d 09 7d 0d 0d | 09 64 69 72 4f 66 66 73 |++;..}..|.dirOffs|
|00003060| 65 74 20 3d 20 6e 65 78 | 74 46 69 6c 65 46 72 65 |et = nex|tFileFre|
|00003070| 65 3b 0d 09 0d 09 69 66 | 20 28 54 57 72 69 74 65 |e;....if| (TWrite|
|00003080| 54 61 67 73 28 72 65 66 | 4e 75 6d 2c 20 62 79 74 |Tags(ref|Num, byt|
|00003090| 65 4f 72 64 65 72 2c 20 | 26 6e 65 78 74 46 69 6c |eOrder, |&nextFil|
|000030a0| 65 46 72 65 65 2c 20 6c | 69 73 74 48 2c 20 30 4c |eFree, l|istH, 0L|
|000030b0| 29 20 21 3d 20 6e 6f 45 | 72 72 29 20 7b 0d 09 09 |) != noE|rr) {...|
|000030c0| 45 72 72 6f 72 4d 65 73 | 73 61 67 65 28 42 41 44 |ErrorMes|sage(BAD|
|000030d0| 57 52 49 54 45 54 41 47 | 53 29 3b 0d 09 09 72 65 |WRITETAG|S);...re|
|000030e0| 74 75 72 6e 3b 0d 09 7d | 0d 09 69 66 20 28 54 57 |turn;..}|..if (TW|
|000030f0| 72 69 74 65 48 65 61 64 | 65 72 28 72 65 66 4e 75 |riteHead|er(refNu|
|00003100| 6d 2c 20 64 69 72 4f 66 | 66 73 65 74 2c 20 62 79 |m, dirOf|fset, by|
|00003110| 74 65 4f 72 64 65 72 29 | 20 21 3d 20 6e 6f 45 72 |teOrder)| != noEr|
|00003120| 72 29 20 7b 0d 09 09 45 | 72 72 6f 72 4d 65 73 73 |r) {...E|rrorMess|
|00003130| 61 67 65 28 42 41 44 57 | 52 49 54 45 48 45 41 44 |age(BADW|RITEHEAD|
|00003140| 45 52 29 3b 0d 09 7d 0d | 7d 0d 0d 2f 2a 0d 20 2a |ER);..}.|}../*. *|
|00003150| 20 46 72 65 65 20 74 68 | 65 20 6c 69 73 74 20 68 | Free th|e list h|
|00003160| 61 6e 64 6c 65 20 61 6e | 64 20 61 6e 79 20 6d 65 |andle an|d any me|
|00003170| 6d 6f 72 79 20 61 6c 6c | 6f 63 61 74 65 64 20 74 |mory all|ocated t|
|00003180| 6f 20 69 6d 61 67 65 20 | 64 65 73 63 72 69 70 74 |o image |descript|
|00003190| 69 6f 6e 20 73 74 72 75 | 63 74 75 72 65 2e 0d 20 |ion stru|cture.. |
|000031a0| 2a 2f 0d 73 74 61 74 69 | 63 20 76 6f 69 64 20 43 |*/.stati|c void C|
|000031b0| 6c 65 61 6e 55 70 28 6c | 69 73 74 48 61 6e 64 6c |leanUp(l|istHandl|
|000031c0| 65 2c 20 69 64 50 74 72 | 29 0d 48 61 6e 64 6c 65 |e, idPtr|).Handle|
|000031d0| 20 6c 69 73 74 48 61 6e | 64 6c 65 3b 0d 69 64 20 | listHan|dle;.id |
|000031e0| 2a 69 64 50 74 72 3b 0d | 7b 0d 09 4d 79 44 69 73 |*idPtr;.|{..MyDis|
|000031f0| 70 6f 73 50 74 72 28 26 | 69 64 50 74 72 2d 3e 62 |posPtr(&|idPtr->b|
|00003200| 69 74 73 50 65 72 53 61 | 6d 70 6c 65 29 3b 0d 09 |itsPerSa|mple);..|
|00003210| 4d 79 44 69 73 70 6f 73 | 50 74 72 28 26 69 64 50 |MyDispos|Ptr(&idP|
|00003220| 74 72 2d 3e 63 6f 6d 70 | 72 65 73 73 69 6f 6e 29 |tr->comp|ression)|
|00003230| 3b 0d 09 4d 79 44 69 73 | 70 6f 73 50 74 72 28 26 |;..MyDis|posPtr(&|
|00003240| 69 64 50 74 72 2d 3e 64 | 6f 63 4e 61 6d 65 29 3b |idPtr->d|ocName);|
|00003250| 0d 09 4d 79 44 69 73 70 | 6f 73 50 74 72 28 26 69 |..MyDisp|osPtr(&i|
|00003260| 64 50 74 72 2d 3e 69 6d | 61 67 65 44 65 73 63 72 |dPtr->im|ageDescr|
|00003270| 69 70 74 69 6f 6e 29 3b | 0d 09 4d 79 44 69 73 70 |iption);|..MyDisp|
|00003280| 6f 73 50 74 72 28 26 69 | 64 50 74 72 2d 3e 6d 61 |osPtr(&i|dPtr->ma|
|00003290| 6b 65 29 3b 0d 09 4d 79 | 44 69 73 70 6f 73 50 74 |ke);..My|DisposPt|
|000032a0| 72 28 26 69 64 50 74 72 | 2d 3e 6d 6f 64 65 6c 29 |r(&idPtr|->model)|
|000032b0| 3b 0d 09 4d 79 44 69 73 | 70 6f 73 50 74 72 28 26 |;..MyDis|posPtr(&|
|000032c0| 69 64 50 74 72 2d 3e 73 | 74 72 69 70 4f 66 66 73 |idPtr->s|tripOffs|
|000032d0| 65 74 73 29 3b 0d 09 4d | 79 44 69 73 70 6f 73 50 |ets);..M|yDisposP|
|000032e0| 74 72 28 26 69 64 50 74 | 72 2d 3e 73 74 72 69 70 |tr(&idPt|r->strip|
|000032f0| 42 79 74 65 43 6f 75 6e | 74 73 29 3b 0d 09 4d 79 |ByteCoun|ts);..My|
|00003300| 44 69 73 70 6f 73 50 74 | 72 28 26 69 64 50 74 72 |DisposPt|r(&idPtr|
|00003310| 2d 3e 6d 69 6e 53 61 6d | 70 6c 65 56 61 6c 75 65 |->minSam|pleValue|
|00003320| 29 3b 0d 09 4d 79 44 69 | 73 70 6f 73 50 74 72 28 |);..MyDi|sposPtr(|
|00003330| 26 69 64 50 74 72 2d 3e | 6d 61 78 53 61 6d 70 6c |&idPtr->|maxSampl|
|00003340| 65 56 61 6c 75 65 29 3b | 0d 09 4d 79 44 69 73 70 |eValue);|..MyDisp|
|00003350| 6f 73 50 74 72 28 26 69 | 64 50 74 72 2d 3e 70 61 |osPtr(&i|dPtr->pa|
|00003360| 67 65 4e 61 6d 65 29 3b | 0d 09 4d 79 44 69 73 70 |geName);|..MyDisp|
|00003370| 6f 73 50 74 72 28 26 69 | 64 50 74 72 2d 3e 66 72 |osPtr(&i|dPtr->fr|
|00003380| 65 65 4f 66 66 73 65 74 | 73 29 3b 0d 09 4d 79 44 |eeOffset|s);..MyD|
|00003390| 69 73 70 6f 73 50 74 72 | 28 26 69 64 50 74 72 2d |isposPtr|(&idPtr-|
|000033a0| 3e 66 72 65 65 42 79 74 | 65 43 6f 75 6e 74 73 29 |>freeByt|eCounts)|
|000033b0| 3b 0d 09 4d 79 44 69 73 | 70 6f 73 50 74 72 28 26 |;..MyDis|posPtr(&|
|000033c0| 69 64 50 74 72 2d 3e 67 | 72 61 79 52 65 73 70 6f |idPtr->g|rayRespo|
|000033d0| 6e 73 65 43 75 72 76 65 | 29 3b 0d 09 4d 79 44 69 |nseCurve|);..MyDi|
|000033e0| 73 70 6f 73 50 74 72 28 | 26 69 64 50 74 72 2d 3e |sposPtr(|&idPtr->|
|000033f0| 63 6f 6c 6f 72 52 65 73 | 70 6f 6e 73 65 43 75 72 |colorRes|ponseCur|
|00003400| 76 65 73 29 3b 0d 09 44 | 69 73 70 6f 73 48 61 6e |ves);..D|isposHan|
|00003410| 64 6c 65 28 6c 69 73 74 | 48 61 6e 64 6c 65 29 3b |dle(list|Handle);|
|00003420| 0d 7d 0d 0d 76 6f 69 64 | 20 49 6e 69 74 49 44 28 |.}..void| InitID(|
|00003430| 69 64 50 74 72 29 0d 69 | 64 20 2a 69 64 50 74 72 |idPtr).i|d *idPtr|
|00003440| 3b 0d 7b 0d 09 69 64 50 | 74 72 2d 3e 73 75 62 66 |;.{..idP|tr->subf|
|00003450| 69 6c 65 54 79 70 65 20 | 3d 20 2d 31 3b 0d 09 69 |ileType |= -1;..i|
|00003460| 64 50 74 72 2d 3e 69 6d | 61 67 65 57 69 64 74 68 |dPtr->im|ageWidth|
|00003470| 20 3d 20 30 3b 0d 09 69 | 64 50 74 72 2d 3e 69 6d | = 0;..i|dPtr->im|
|00003480| 61 67 65 4c 65 6e 67 74 | 68 20 3d 20 30 3b 0d 09 |ageLengt|h = 0;..|
|00003490| 69 64 50 74 72 2d 3e 62 | 69 74 73 50 65 72 53 61 |idPtr->b|itsPerSa|
|000034a0| 6d 70 6c 65 20 3d 20 6e | 69 6c 3b 0d 09 69 64 50 |mple = n|il;..idP|
|000034b0| 74 72 2d 3e 63 6f 6d 70 | 72 65 73 73 69 6f 6e 20 |tr->comp|ression |
|000034c0| 3d 20 6e 69 6c 3b 0d 09 | 69 64 50 74 72 2d 3e 70 |= nil;..|idPtr->p|
|000034d0| 68 6f 74 6f 49 6e 74 65 | 72 70 20 3d 20 2d 31 3b |hotoInte|rp = -1;|
|000034e0| 0d 09 69 64 50 74 72 2d | 3e 74 68 72 65 73 68 68 |..idPtr-|>threshh|
|000034f0| 6f 6c 64 69 6e 67 20 3d | 20 2d 31 3b 0d 09 69 64 |olding =| -1;..id|
|00003500| 50 74 72 2d 3e 63 65 6c | 6c 57 69 64 74 68 20 3d |Ptr->cel|lWidth =|
|00003510| 20 2d 31 3b 0d 09 69 64 | 50 74 72 2d 3e 63 65 6c | -1;..id|Ptr->cel|
|00003520| 6c 4c 65 6e 67 74 68 20 | 3d 20 2d 31 3b 0d 09 69 |lLength |= -1;..i|
|00003530| 64 50 74 72 2d 3e 66 69 | 6c 6c 4f 72 64 65 72 20 |dPtr->fi|llOrder |
|00003540| 3d 20 30 3b 0d 09 69 64 | 50 74 72 2d 3e 64 6f 63 |= 0;..id|Ptr->doc|
|00003550| 4e 61 6d 65 20 3d 20 6e | 69 6c 3b 0d 09 69 64 50 |Name = n|il;..idP|
|00003560| 74 72 2d 3e 69 6d 61 67 | 65 44 65 73 63 72 69 70 |tr->imag|eDescrip|
|00003570| 74 69 6f 6e 20 3d 20 6e | 69 6c 3b 0d 09 69 64 50 |tion = n|il;..idP|
|00003580| 74 72 2d 3e 6d 61 6b 65 | 20 3d 20 6e 69 6c 3b 0d |tr->make| = nil;.|
|00003590| 09 69 64 50 74 72 2d 3e | 6d 6f 64 65 6c 20 3d 20 |.idPtr->|model = |
|000035a0| 6e 69 6c 3b 0d 09 69 64 | 50 74 72 2d 3e 73 74 72 |nil;..id|Ptr->str|
|000035b0| 69 70 4f 66 66 73 65 74 | 73 20 3d 20 6e 69 6c 3b |ipOffset|s = nil;|
|000035c0| 0d 09 69 64 50 74 72 2d | 3e 6f 72 69 65 6e 74 61 |..idPtr-|>orienta|
|000035d0| 74 69 6f 6e 20 3d 20 2d | 31 3b 0d 09 69 64 50 74 |tion = -|1;..idPt|
|000035e0| 72 2d 3e 73 61 6d 70 6c | 65 73 50 65 72 50 69 78 |r->sampl|esPerPix|
|000035f0| 65 6c 20 3d 20 30 3b 0d | 09 69 64 50 74 72 2d 3e |el = 0;.|.idPtr->|
|00003600| 72 6f 77 73 50 65 72 53 | 74 72 69 70 20 3d 20 30 |rowsPerS|trip = 0|
|00003610| 3b 0d 09 69 64 50 74 72 | 2d 3e 73 74 72 69 70 73 |;..idPtr|->strips|
|00003620| 50 65 72 49 6d 61 67 65 | 20 3d 20 30 3b 0d 09 69 |PerImage| = 0;..i|
|00003630| 64 50 74 72 2d 3e 73 74 | 72 69 70 42 79 74 65 43 |dPtr->st|ripByteC|
|00003640| 6f 75 6e 74 73 20 3d 20 | 6e 69 6c 3b 0d 09 69 64 |ounts = |nil;..id|
|00003650| 50 74 72 2d 3e 6d 69 6e | 53 61 6d 70 6c 65 56 61 |Ptr->min|SampleVa|
|00003660| 6c 75 65 20 3d 20 6e 69 | 6c 3b 0d 09 69 64 50 74 |lue = ni|l;..idPt|
|00003670| 72 2d 3e 6d 61 78 53 61 | 6d 70 6c 65 56 61 6c 75 |r->maxSa|mpleValu|
|00003680| 65 20 3d 20 6e 69 6c 3b | 0d 09 69 64 50 74 72 2d |e = nil;|..idPtr-|
|00003690| 3e 78 52 65 73 6f 6c 75 | 74 69 6f 6e 2e 6e 75 6d |>xResolu|tion.num|
|000036a0| 65 72 61 74 6f 72 20 3d | 20 30 3b 0d 09 69 64 50 |erator =| 0;..idP|
|000036b0| 74 72 2d 3e 78 52 65 73 | 6f 6c 75 74 69 6f 6e 2e |tr->xRes|olution.|
|000036c0| 64 65 6e 6f 6d 69 6e 61 | 74 6f 72 20 3d 20 30 3b |denomina|tor = 0;|
|000036d0| 0d 09 69 64 50 74 72 2d | 3e 79 52 65 73 6f 6c 75 |..idPtr-|>yResolu|
|000036e0| 74 69 6f 6e 2e 6e 75 6d | 65 72 61 74 6f 72 20 3d |tion.num|erator =|
|000036f0| 20 30 3b 0d 09 69 64 50 | 74 72 2d 3e 79 52 65 73 | 0;..idP|tr->yRes|
|00003700| 6f 6c 75 74 69 6f 6e 2e | 64 65 6e 6f 6d 69 6e 61 |olution.|denomina|
|00003710| 74 6f 72 20 3d 20 30 3b | 0d 09 69 64 50 74 72 2d |tor = 0;|..idPtr-|
|00003720| 3e 70 6c 61 6e 61 72 43 | 6f 6e 66 69 67 20 3d 20 |>planarC|onfig = |
|00003730| 2d 31 3b 0d 09 69 64 50 | 74 72 2d 3e 70 61 67 65 |-1;..idP|tr->page|
|00003740| 4e 61 6d 65 20 3d 20 6e | 69 6c 3b 0d 09 69 64 50 |Name = n|il;..idP|
|00003750| 74 72 2d 3e 78 50 6f 73 | 69 74 69 6f 6e 2e 6e 75 |tr->xPos|ition.nu|
|00003760| 6d 65 72 61 74 6f 72 20 | 3d 20 30 3b 0d 09 69 64 |merator |= 0;..id|
|00003770| 50 74 72 2d 3e 78 50 6f | 73 69 74 69 6f 6e 2e 64 |Ptr->xPo|sition.d|
|00003780| 65 6e 6f 6d 69 6e 61 74 | 6f 72 20 3d 20 30 3b 0d |enominat|or = 0;.|
|00003790| 09 69 64 50 74 72 2d 3e | 79 50 6f 73 69 74 69 6f |.idPtr->|yPositio|
|000037a0| 6e 2e 6e 75 6d 65 72 61 | 74 6f 72 20 3d 20 30 3b |n.numera|tor = 0;|
|000037b0| 0d 09 69 64 50 74 72 2d | 3e 79 50 6f 73 69 74 69 |..idPtr-|>yPositi|
|000037c0| 6f 6e 2e 64 65 6e 6f 6d | 69 6e 61 74 6f 72 20 3d |on.denom|inator =|
|000037d0| 20 30 3b 0d 09 69 64 50 | 74 72 2d 3e 66 72 65 65 | 0;..idP|tr->free|
|000037e0| 4f 66 66 73 65 74 73 20 | 3d 20 6e 69 6c 3b 0d 09 |Offsets |= nil;..|
|000037f0| 69 64 50 74 72 2d 3e 66 | 72 65 65 42 79 74 65 43 |idPtr->f|reeByteC|
|00003800| 6f 75 6e 74 73 20 3d 20 | 6e 69 6c 3b 0d 09 69 64 |ounts = |nil;..id|
|00003810| 50 74 72 2d 3e 67 72 61 | 79 52 65 73 70 6f 6e 73 |Ptr->gra|yRespons|
|00003820| 65 55 6e 69 74 20 3d 20 | 2d 31 3b 0d 09 69 64 50 |eUnit = |-1;..idP|
|00003830| 74 72 2d 3e 67 72 61 79 | 52 65 73 70 6f 6e 73 65 |tr->gray|Response|
|00003840| 43 75 72 76 65 20 3d 20 | 6e 69 6c 3b 0d 09 69 64 |Curve = |nil;..id|
|00003850| 50 74 72 2d 3e 67 72 6f | 75 70 33 4f 70 74 69 6f |Ptr->gro|up3Optio|
|00003860| 6e 73 20 3d 20 30 3b 0d | 09 69 64 50 74 72 2d 3e |ns = 0;.|.idPtr->|
|00003870| 67 72 6f 75 70 34 4f 70 | 74 69 6f 6e 73 20 3d 20 |group4Op|tions = |
|00003880| 30 3b 0d 09 69 64 50 74 | 72 2d 3e 72 65 73 6f 6c |0;..idPt|r->resol|
|00003890| 75 74 69 6f 6e 55 6e 69 | 74 20 3d 20 2d 31 3b 0d |utionUni|t = -1;.|
|000038a0| 09 69 64 50 74 72 2d 3e | 70 61 67 65 4e 75 6d 62 |.idPtr->|pageNumb|
|000038b0| 65 72 5b 30 5d 20 3d 20 | 30 3b 0d 09 69 64 50 74 |er[0] = |0;..idPt|
|000038c0| 72 2d 3e 70 61 67 65 4e | 75 6d 62 65 72 5b 31 5d |r->pageN|umber[1]|
|000038d0| 20 3d 20 30 3b 0d 09 69 | 64 50 74 72 2d 3e 63 6f | = 0;..i|dPtr->co|
|000038e0| 6c 6f 72 52 65 73 70 6f | 6e 73 65 55 6e 69 74 20 |lorRespo|nseUnit |
|000038f0| 3d 20 2d 31 3b 0d 09 69 | 64 50 74 72 2d 3e 63 6f |= -1;..i|dPtr->co|
|00003900| 6c 6f 72 52 65 73 70 6f | 6e 73 65 43 75 72 76 65 |lorRespo|nseCurve|
|00003910| 73 20 3d 20 6e 69 6c 3b | 0d 7d 0d 0d 54 69 66 66 |s = nil;|.}..Tiff|
|00003920| 44 69 72 45 6e 74 72 79 | 20 47 65 74 44 69 72 45 |DirEntry| GetDirE|
|00003930| 6e 74 72 79 28 6c 69 73 | 74 48 61 6e 64 6c 65 2c |ntry(lis|tHandle,|
|00003940| 20 74 61 67 4f 66 66 73 | 65 74 29 0d 48 61 6e 64 | tagOffs|et).Hand|
|00003950| 6c 65 09 6c 69 73 74 48 | 61 6e 64 6c 65 3b 0d 49 |le.listH|andle;.I|
|00003960| 6e 74 33 32 09 74 61 67 | 4f 66 66 73 65 74 3b 0d |nt32.tag|Offset;.|
|00003970| 7b 0d 09 50 74 72 09 09 | 09 09 70 3b 0d 09 0d 09 |{..Ptr..|..p;....|
|00003980| 0d 09 2f 2a 20 67 65 74 | 20 70 6f 69 6e 74 65 72 |../* get| pointer|
|00003990| 20 74 6f 20 74 61 67 20 | 6c 69 73 74 20 2a 2f 0d | to tag |list */.|
|000039a0| 09 70 20 3d 20 26 28 2a | 2a 6c 69 73 74 48 61 6e |.p = &(*|*listHan|
|000039b0| 64 6c 65 29 3b 09 2f 2a | 20 48 41 4e 44 4c 45 20 |dle);./*| HANDLE |
|000039c0| 44 45 52 45 46 45 52 45 | 4e 43 45 20 2a 2f 0d 09 |DEREFERE|NCE */..|
|000039d0| 2f 2a 20 67 65 74 20 70 | 6f 69 6e 74 65 72 20 74 |/* get p|ointer t|
|000039e0| 6f 20 6f 75 72 20 74 61 | 67 27 73 20 64 69 72 65 |o our ta|g's dire|
|000039f0| 63 74 6f 72 79 20 65 6e | 74 72 79 20 2a 2f 0d 09 |ctory en|try */..|
|00003a00| 70 20 2b 3d 20 74 61 67 | 4f 66 66 73 65 74 3b 0d |p += tag|Offset;.|
|00003a10| 09 2f 2a 20 72 65 74 75 | 72 6e 20 74 68 65 20 77 |./* retu|rn the w|
|00003a20| 68 6f 6c 65 20 44 69 72 | 65 63 74 6f 72 79 20 45 |hole Dir|ectory E|
|00003a30| 6e 74 72 79 20 53 74 72 | 75 63 74 75 72 65 2c 20 |ntry Str|ucture, |
|00003a40| 6e 6f 74 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f |not a po|inter to|
|00003a50| 20 69 74 20 2a 2f 0d 09 | 72 65 74 75 72 6e 28 2a | it */..|return(*|
|00003a60| 28 28 54 69 66 66 44 69 | 72 45 6e 74 72 79 20 2a |((TiffDi|rEntry *|
|00003a70| 29 70 29 29 3b 0d 7d 0d | 0d 0d 49 6e 74 31 36 20 |)p));.}.|..Int16 |
|00003a80| 54 79 70 65 53 69 7a 65 | 28 74 79 70 65 29 0d 49 |TypeSize|(type).I|
|00003a90| 6e 74 31 36 20 74 79 70 | 65 3b 0d 7b 0d 09 73 77 |nt16 typ|e;.{..sw|
|00003aa0| 69 74 63 68 20 28 74 79 | 70 65 29 20 7b 0d 09 09 |itch (ty|pe) {...|
|00003ab0| 63 61 73 65 20 42 59 54 | 45 3a 0d 09 09 09 72 65 |case BYT|E:....re|
|00003ac0| 74 75 72 6e 28 42 59 54 | 45 53 49 5a 45 29 3b 0d |turn(BYT|ESIZE);.|
|00003ad0| 09 09 63 61 73 65 20 41 | 53 43 49 49 3a 0d 09 09 |..case A|SCII:...|
|00003ae0| 09 72 65 74 75 72 6e 28 | 41 53 43 49 49 53 49 5a |.return(|ASCIISIZ|
|00003af0| 45 29 3b 0d 09 09 63 61 | 73 65 20 53 48 4f 52 54 |E);...ca|se SHORT|
|00003b00| 3a 0d 09 09 09 72 65 74 | 75 72 6e 28 53 48 4f 52 |:....ret|urn(SHOR|
|00003b10| 54 53 49 5a 45 29 3b 0d | 09 09 63 61 73 65 20 4c |TSIZE);.|..case L|
|00003b20| 4f 4e 47 3a 0d 09 09 09 | 72 65 74 75 72 6e 28 4c |ONG:....|return(L|
|00003b30| 4f 4e 47 53 49 5a 45 29 | 3b 0d 09 09 63 61 73 65 |ONGSIZE)|;...case|
|00003b40| 20 52 41 54 53 49 5a 45 | 3a 0d 09 09 09 72 65 74 | RATSIZE|:....ret|
|00003b50| 75 72 6e 28 52 41 54 53 | 49 5a 45 29 3b 0d 09 7d |urn(RATS|IZE);..}|
|00003b60| 0d 7d 0d 0d 50 74 72 20 | 53 65 74 49 44 50 74 72 |.}..Ptr |SetIDPtr|
|00003b70| 28 6c 69 73 74 48 61 6e | 64 6c 65 2c 20 74 61 67 |(listHan|dle, tag|
|00003b80| 2c 20 64 65 66 61 75 6c | 74 56 61 6c 75 65 2c 20 |, defaul|tValue, |
|00003b90| 64 65 66 61 75 6c 74 54 | 79 70 65 29 0d 48 61 6e |defaultT|ype).Han|
|00003ba0| 64 6c 65 20 6c 69 73 74 | 48 61 6e 64 6c 65 3b 0d |dle list|Handle;.|
|00003bb0| 49 6e 74 31 36 20 74 61 | 67 3b 0d 49 6e 74 33 32 |Int16 ta|g;.Int32|
|00003bc0| 20 64 65 66 61 75 6c 74 | 56 61 6c 75 65 3b 09 09 | default|Value;..|
|00003bd0| 2f 2a 20 77 6f 6e 27 74 | 20 68 61 6e 64 6c 65 20 |/* won't| handle |
|00003be0| 64 65 66 61 75 6c 74 73 | 20 6c 61 72 67 65 72 20 |defaults| larger |
|00003bf0| 74 68 61 6e 20 34 20 62 | 79 74 65 73 20 2a 2f 0d |than 4 b|ytes */.|
|00003c00| 49 6e 74 33 32 20 64 65 | 66 61 75 6c 74 54 79 70 |Int32 de|faultTyp|
|00003c10| 65 3b 0d 7b 0d 09 54 69 | 66 66 44 69 72 45 6e 74 |e;.{..Ti|ffDirEnt|
|00003c20| 72 79 09 74 61 67 44 45 | 3b 0d 09 50 74 72 09 09 |ry.tagDE|;..Ptr..|
|00003c30| 09 09 70 3b 0d 09 49 6e | 74 33 32 09 09 09 74 61 |..p;..In|t32...ta|
|00003c40| 67 4f 66 66 73 65 74 2c | 0d 09 09 09 09 09 73 69 |gOffset,|......si|
|00003c50| 7a 65 2c 0d 09 09 09 09 | 09 6e 76 61 6c 73 3b 0d |ze,.....|.nvals;.|
|00003c60| 09 0d 09 69 66 20 28 54 | 46 69 6e 64 54 61 67 28 |...if (T|FindTag(|
|00003c70| 6c 69 73 74 48 61 6e 64 | 6c 65 2c 20 26 74 61 67 |listHand|le, &tag|
|00003c80| 4f 66 66 73 65 74 2c 20 | 74 61 67 29 29 20 7b 0d |Offset, |tag)) {.|
|00003c90| 09 09 74 61 67 44 45 20 | 3d 20 47 65 74 44 69 72 |..tagDE |= GetDir|
|00003ca0| 45 6e 74 72 79 28 6c 69 | 73 74 48 61 6e 64 6c 65 |Entry(li|stHandle|
|00003cb0| 2c 20 74 61 67 4f 66 66 | 73 65 74 29 3b 0d 09 09 |, tagOff|set);...|
|00003cc0| 73 69 7a 65 20 3d 20 54 | 79 70 65 53 69 7a 65 28 |size = T|ypeSize(|
|00003cd0| 74 61 67 44 45 2e 74 79 | 70 65 29 20 2a 20 74 61 |tagDE.ty|pe) * ta|
|00003ce0| 67 44 45 2e 6c 65 6e 67 | 74 68 3b 0d 09 09 69 66 |gDE.leng|th;...if|
|00003cf0| 20 28 28 70 20 3d 20 4d | 79 4e 65 77 50 74 72 28 | ((p = M|yNewPtr(|
|00003d00| 73 69 7a 65 29 29 20 21 | 3d 20 6e 69 6c 29 0d 09 |size)) !|= nil)..|
|00003d10| 09 09 54 47 65 74 54 61 | 67 28 6c 69 73 74 48 61 |..TGetTa|g(listHa|
|00003d20| 6e 64 6c 65 2c 20 74 61 | 67 4f 66 66 73 65 74 2c |ndle, ta|gOffset,|
|00003d30| 20 70 2c 20 73 69 7a 65 | 29 3b 0d 09 7d 0d 09 65 | p, size|);..}..e|
|00003d40| 6c 73 65 20 69 66 20 28 | 64 65 66 61 75 6c 74 54 |lse if (|defaultT|
|00003d50| 79 70 65 20 21 3d 20 30 | 29 20 7b 0d 09 09 69 66 |ype != 0|) {...if|
|00003d60| 20 28 28 70 20 3d 20 4d | 79 4e 65 77 50 74 72 28 | ((p = M|yNewPtr(|
|00003d70| 64 65 66 61 75 6c 74 54 | 79 70 65 29 29 20 21 3d |defaultT|ype)) !=|
|00003d80| 20 6e 69 6c 29 20 7b 0d | 09 09 09 73 77 69 74 63 | nil) {.|...switc|
|00003d90| 68 20 28 64 65 66 61 75 | 6c 74 54 79 70 65 29 20 |h (defau|ltType) |
|00003da0| 7b 0d 09 09 09 09 63 61 | 73 65 20 42 59 54 45 3a |{.....ca|se BYTE:|
|00003db0| 0d 09 09 09 09 09 2a 28 | 75 6e 73 69 67 6e 65 64 |......*(|unsigned|
|00003dc0| 20 63 68 61 72 20 2a 29 | 70 20 3d 20 64 65 66 61 | char *)|p = defa|
|00003dd0| 75 6c 74 56 61 6c 75 65 | 3b 0d 09 09 09 09 09 62 |ultValue|;......b|
|00003de0| 72 65 61 6b 3b 0d 09 09 | 09 09 63 61 73 65 20 41 |reak;...|..case A|
|00003df0| 53 43 49 49 3a 0d 09 09 | 09 09 09 2a 28 75 6e 73 |SCII:...|...*(uns|
|00003e00| 69 67 6e 65 64 20 63 68 | 61 72 20 2a 29 70 20 3d |igned ch|ar *)p =|
|00003e10| 20 64 65 66 61 75 6c 74 | 56 61 6c 75 65 3b 0d 09 | default|Value;..|
|00003e20| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 63 |....brea|k;.....c|
|00003e30| 61 73 65 20 53 48 4f 52 | 54 3a 0d 09 09 09 09 09 |ase SHOR|T:......|
|00003e40| 2a 28 75 6e 73 69 67 6e | 65 64 20 73 68 6f 72 74 |*(unsign|ed short|
|00003e50| 20 2a 29 70 20 3d 20 64 | 65 66 61 75 6c 74 56 61 | *)p = d|efaultVa|
|00003e60| 6c 75 65 3b 0d 09 09 09 | 09 09 62 72 65 61 6b 3b |lue;....|..break;|
|00003e70| 0d 09 09 09 09 63 61 73 | 65 20 4c 4f 4e 47 3a 0d |.....cas|e LONG:.|
|00003e80| 09 09 09 09 09 2a 28 75 | 6e 73 69 67 6e 65 64 20 |.....*(u|nsigned |
|00003e90| 6c 6f 6e 67 20 2a 29 70 | 20 3d 20 64 65 66 61 75 |long *)p| = defau|
|00003ea0| 6c 74 56 61 6c 75 65 3b | 0d 09 09 09 09 09 62 72 |ltValue;|......br|
|00003eb0| 65 61 6b 3b 0d 09 09 09 | 09 63 61 73 65 20 52 41 |eak;....|.case RA|
|00003ec0| 54 49 4f 4e 41 4c 3a 0d | 09 09 09 09 09 28 28 52 |TIONAL:.|.....((R|
|00003ed0| 61 74 69 6f 6e 61 6c 20 | 2a 29 70 29 2d 3e 6e 75 |ational |*)p)->nu|
|00003ee0| 6d 65 72 61 74 6f 72 20 | 3d 20 64 65 66 61 75 6c |merator |= defaul|
|00003ef0| 74 56 61 6c 75 65 3b 0d | 09 09 09 09 09 28 28 52 |tValue;.|.....((R|
|00003f00| 61 74 69 6f 6e 61 6c 20 | 2a 29 70 29 2d 3e 64 65 |ational |*)p)->de|
|00003f10| 6e 6f 6d 69 6e 61 74 6f | 72 20 3d 20 31 3b 0d 09 |nominato|r = 1;..|
|00003f20| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 7d 0d |....brea|k;....}.|
|00003f30| 09 09 7d 0d 09 7d 0d 09 | 65 6c 73 65 0d 09 09 70 |..}..}..|else...p|
|00003f40| 20 3d 20 6e 69 6c 3b 0d | 09 72 65 74 75 72 6e 28 | = nil;.|.return(|
|00003f50| 70 29 3b 0d 7d 0d 0d 23 | 69 66 64 65 66 20 44 45 |p);.}..#|ifdef DE|
|00003f60| 42 55 47 0d 44 69 73 70 | 6c 61 79 49 44 28 69 64 |BUG.Disp|layID(id|
|00003f70| 50 74 72 29 0d 69 64 20 | 2a 69 64 50 74 72 3b 0d |Ptr).id |*idPtr;.|
|00003f80| 7b 0d 09 44 65 62 75 67 | 4d 65 73 73 61 67 65 28 |{..Debug|Message(|
|00003f90| 22 73 75 62 66 69 6c 65 | 54 79 70 65 3d 25 6c 64 |"subfile|Type=%ld|
|00003fa0| 20 69 6d 61 67 65 57 69 | 64 74 68 3d 25 6c 64 20 | imageWi|dth=%ld |
|00003fb0| 69 6d 61 67 65 4c 65 6e | 67 74 68 3d 25 6c 64 20 |imageLen|gth=%ld |
|00003fc0| 62 69 74 73 50 65 72 53 | 61 6d 70 6c 65 3d 25 6c |bitsPerS|ample=%l|
|00003fd0| 64 22 2c 0d 09 09 09 09 | 69 64 50 74 72 2d 3e 73 |d",.....|idPtr->s|
|00003fe0| 75 62 66 69 6c 65 54 79 | 70 65 2c 0d 09 09 09 09 |ubfileTy|pe,.....|
|00003ff0| 69 64 50 74 72 2d 3e 69 | 6d 61 67 65 57 69 64 74 |idPtr->i|mageWidt|
|00004000| 68 2c 0d 09 09 09 09 69 | 64 50 74 72 2d 3e 69 6d |h,.....i|dPtr->im|
|00004010| 61 67 65 4c 65 6e 67 74 | 68 2c 0d 09 09 09 09 69 |ageLengt|h,.....i|
|00004020| 64 50 74 72 2d 3e 62 69 | 74 73 50 65 72 53 61 6d |dPtr->bi|tsPerSam|
|00004030| 70 6c 65 20 21 3d 20 6e | 69 6c 20 3f 20 2a 69 64 |ple != n|il ? *id|
|00004040| 50 74 72 2d 3e 62 69 74 | 73 50 65 72 53 61 6d 70 |Ptr->bit|sPerSamp|
|00004050| 6c 65 20 3a 20 2d 31 29 | 3b 0d 09 0d 09 44 65 62 |le : -1)|;....Deb|
|00004060| 75 67 4d 65 73 73 61 67 | 65 28 22 63 6f 6d 70 72 |ugMessag|e("compr|
|00004070| 65 73 73 69 6f 6e 3d 25 | 6c 64 20 70 68 6f 74 6f |ession=%|ld photo|
|00004080| 49 6e 74 65 72 70 3d 25 | 6c 64 20 74 68 72 65 73 |Interp=%|ld thres|
|00004090| 68 68 6f 6c 64 69 6e 67 | 3d 25 6c 64 20 63 65 6c |hholding|=%ld cel|
|000040a0| 6c 57 69 64 74 68 3d 25 | 6c 64 20 63 65 6c 6c 4c |lWidth=%|ld cellL|
|000040b0| 65 6e 67 74 68 3d 25 6c | 64 22 2c 0d 09 09 09 09 |ength=%l|d",.....|
|000040c0| 69 64 50 74 72 2d 3e 63 | 6f 6d 70 72 65 73 73 69 |idPtr->c|ompressi|
|000040d0| 6f 6e 20 21 3d 20 6e 69 | 6c 20 3f 20 2a 69 64 50 |on != ni|l ? *idP|
|000040e0| 74 72 2d 3e 63 6f 6d 70 | 72 65 73 73 69 6f 6e 20 |tr->comp|ression |
|000040f0| 3a 20 2d 31 2c 0d 09 09 | 09 09 69 64 50 74 72 2d |: -1,...|..idPtr-|
|00004100| 3e 70 68 6f 74 6f 49 6e | 74 65 72 70 2c 0d 09 09 |>photoIn|terp,...|
|00004110| 09 09 69 64 50 74 72 2d | 3e 74 68 72 65 73 68 68 |..idPtr-|>threshh|
|00004120| 6f 6c 64 69 6e 67 2c 0d | 09 09 09 09 69 64 50 74 |olding,.|....idPt|
|00004130| 72 2d 3e 63 65 6c 6c 57 | 69 64 74 68 2c 0d 09 09 |r->cellW|idth,...|
|00004140| 09 09 69 64 50 74 72 2d | 3e 63 65 6c 6c 4c 65 6e |..idPtr-|>cellLen|
|00004150| 67 74 68 29 3b 0d 0d 09 | 44 65 62 75 67 4d 65 73 |gth);...|DebugMes|
|00004160| 73 61 67 65 28 22 66 69 | 6c 6c 4f 72 64 65 72 3d |sage("fi|llOrder=|
|00004170| 25 6c 64 20 64 6f 63 4e | 61 6d 65 3d 25 73 20 69 |%ld docN|ame=%s i|
|00004180| 6d 61 67 65 44 65 73 63 | 72 69 70 74 69 6f 6e 3d |mageDesc|ription=|
|00004190| 25 73 20 6d 61 6b 65 3d | 25 73 20 6d 6f 64 65 6c |%s make=|%s model|
|000041a0| 3d 25 73 22 2c 0d 09 09 | 09 09 69 64 50 74 72 2d |=%s",...|..idPtr-|
|000041b0| 3e 66 69 6c 6c 4f 72 64 | 65 72 2c 0d 09 09 09 09 |>fillOrd|er,.....|
|000041c0| 69 64 50 74 72 2d 3e 64 | 6f 63 4e 61 6d 65 2c 0d |idPtr->d|ocName,.|
|000041d0| 09 09 09 09 69 64 50 74 | 72 2d 3e 69 6d 61 67 65 |....idPt|r->image|
|000041e0| 44 65 73 63 72 69 70 74 | 69 6f 6e 2c 0d 09 09 09 |Descript|ion,....|
|000041f0| 09 69 64 50 74 72 2d 3e | 6d 61 6b 65 2c 0d 09 09 |.idPtr->|make,...|
|00004200| 09 09 69 64 50 74 72 2d | 3e 6d 6f 64 65 6c 29 3b |..idPtr-|>model);|
|00004210| 0d 09 0d 09 2f 2a 20 69 | 64 50 74 72 2d 3e 73 74 |..../* i|dPtr->st|
|00004220| 72 69 70 4f 66 66 73 65 | 74 73 20 3d 20 6e 69 6c |ripOffse|ts = nil|
|00004230| 3b 20 2a 2f 0d 09 0d 09 | 44 65 62 75 67 4d 65 73 |; */....|DebugMes|
|00004240| 73 61 67 65 28 22 6f 72 | 69 65 6e 74 61 74 69 6f |sage("or|ientatio|
|00004250| 6e 3d 25 6c 64 20 73 61 | 6d 70 6c 65 73 50 65 72 |n=%ld sa|mplesPer|
|00004260| 50 69 78 65 6c 3d 25 6c | 64 20 72 6f 77 73 50 65 |Pixel=%l|d rowsPe|
|00004270| 72 53 74 72 69 70 3d 25 | 6c 64 20 73 74 72 69 70 |rStrip=%|ld strip|
|00004280| 73 50 65 72 49 6d 61 67 | 65 3d 25 6c 64 22 2c 0d |sPerImag|e=%ld",.|
|00004290| 09 09 09 09 69 64 50 74 | 72 2d 3e 6f 72 69 65 6e |....idPt|r->orien|
|000042a0| 74 61 74 69 6f 6e 2c 0d | 09 09 09 09 69 64 50 74 |tation,.|....idPt|
|000042b0| 72 2d 3e 73 61 6d 70 6c | 65 73 50 65 72 50 69 78 |r->sampl|esPerPix|
|000042c0| 65 6c 2c 0d 09 09 09 09 | 69 64 50 74 72 2d 3e 72 |el,.....|idPtr->r|
|000042d0| 6f 77 73 50 65 72 53 74 | 72 69 70 20 21 3d 20 49 |owsPerSt|rip != I|
|000042e0| 4e 46 49 4e 49 54 59 20 | 3f 20 69 64 50 74 72 2d |NFINITY |? idPtr-|
|000042f0| 3e 72 6f 77 73 50 65 72 | 53 74 72 69 70 20 3a 20 |>rowsPer|Strip : |
|00004300| 2d 31 2c 0d 09 09 09 09 | 69 64 50 74 72 2d 3e 73 |-1,.....|idPtr->s|
|00004310| 74 72 69 70 73 50 65 72 | 49 6d 61 67 65 29 3b 0d |tripsPer|Image);.|
|00004320| 09 0d 09 2f 2a 20 69 64 | 50 74 72 2d 3e 73 74 72 |.../* id|Ptr->str|
|00004330| 69 70 42 79 74 65 43 6f | 75 6e 74 73 20 3d 20 6e |ipByteCo|unts = n|
|00004340| 69 6c 3b 20 2a 2f 0d 09 | 0d 09 44 65 62 75 67 4d |il; */..|..DebugM|
|00004350| 65 73 73 61 67 65 28 22 | 6d 69 6e 53 61 6d 70 6c |essage("|minSampl|
|00004360| 65 56 61 6c 75 65 3d 25 | 6c 64 20 6d 61 78 53 61 |eValue=%|ld maxSa|
|00004370| 6d 70 6c 65 56 61 6c 75 | 65 3d 25 6c 64 22 2c 0d |mpleValu|e=%ld",.|
|00004380| 09 09 09 09 69 64 50 74 | 72 2d 3e 6d 69 6e 53 61 |....idPt|r->minSa|
|00004390| 6d 70 6c 65 56 61 6c 75 | 65 20 3f 20 2a 69 64 50 |mpleValu|e ? *idP|
|000043a0| 74 72 2d 3e 6d 69 6e 53 | 61 6d 70 6c 65 56 61 6c |tr->minS|ampleVal|
|000043b0| 75 65 20 3a 20 2d 31 2c | 0d 09 09 09 09 69 64 50 |ue : -1,|.....idP|
|000043c0| 74 72 2d 3e 6d 61 78 53 | 61 6d 70 6c 65 56 61 6c |tr->maxS|ampleVal|
|000043d0| 75 65 20 3f 20 2a 69 64 | 50 74 72 2d 3e 6d 61 78 |ue ? *id|Ptr->max|
|000043e0| 53 61 6d 70 6c 65 56 61 | 6c 75 65 20 3a 20 2d 31 |SampleVa|lue : -1|
|000043f0| 29 3b 0d 09 0d 09 44 65 | 62 75 67 4d 65 73 73 61 |);....De|bugMessa|
|00004400| 67 65 28 22 78 52 65 73 | 3d 25 6c 64 2f 25 6c 64 |ge("xRes|=%ld/%ld|
|00004410| 20 79 52 65 73 3d 25 6c | 64 2f 25 6c 64 20 70 6c | yRes=%l|d/%ld pl|
|00004420| 61 6e 61 72 43 6f 6e 66 | 69 67 3d 25 6c 64 22 2c |anarConf|ig=%ld",|
|00004430| 0d 09 09 09 09 69 64 50 | 74 72 2d 3e 78 52 65 73 |.....idP|tr->xRes|
|00004440| 6f 6c 75 74 69 6f 6e 2e | 6e 75 6d 65 72 61 74 6f |olution.|numerato|
|00004450| 72 2c 0d 09 09 09 09 69 | 64 50 74 72 2d 3e 78 52 |r,.....i|dPtr->xR|
|00004460| 65 73 6f 6c 75 74 69 6f | 6e 2e 64 65 6e 6f 6d 69 |esolutio|n.denomi|
|00004470| 6e 61 74 6f 72 2c 0d 09 | 09 09 09 69 64 50 74 72 |nator,..|...idPtr|
|00004480| 2d 3e 79 52 65 73 6f 6c | 75 74 69 6f 6e 2e 6e 75 |->yResol|ution.nu|
|00004490| 6d 65 72 61 74 6f 72 2c | 0d 09 09 09 09 69 64 50 |merator,|.....idP|
|000044a0| 74 72 2d 3e 79 52 65 73 | 6f 6c 75 74 69 6f 6e 2e |tr->yRes|olution.|
|000044b0| 64 65 6e 6f 6d 69 6e 61 | 74 6f 72 2c 0d 09 09 09 |denomina|tor,....|
|000044c0| 09 69 64 50 74 72 2d 3e | 70 6c 61 6e 61 72 43 6f |.idPtr->|planarCo|
|000044d0| 6e 66 69 67 29 3b 0d 09 | 2f 2a 09 09 09 0d 09 69 |nfig);..|/*.....i|
|000044e0| 64 50 74 72 2d 3e 70 61 | 67 65 4e 61 6d 65 20 3d |dPtr->pa|geName =|
|000044f0| 20 6e 69 6c 3b 0d 09 69 | 64 50 74 72 2d 3e 78 50 | nil;..i|dPtr->xP|
|00004500| 6f 73 69 74 69 6f 6e 2e | 6e 75 6d 65 72 61 74 6f |osition.|numerato|
|00004510| 72 20 3d 20 30 3b 0d 09 | 69 64 50 74 72 2d 3e 78 |r = 0;..|idPtr->x|
|00004520| 50 6f 73 69 74 69 6f 6e | 2e 64 65 6e 6f 6d 69 6e |Position|.denomin|
|00004530| 61 74 6f 72 20 3d 20 30 | 3b 0d 09 69 64 50 74 72 |ator = 0|;..idPtr|
|00004540| 2d 3e 79 50 6f 73 69 74 | 69 6f 6e 2e 6e 75 6d 65 |->yPosit|ion.nume|
|00004550| 72 61 74 6f 72 20 3d 20 | 30 3b 0d 09 69 64 50 74 |rator = |0;..idPt|
|00004560| 72 2d 3e 79 50 6f 73 69 | 74 69 6f 6e 2e 64 65 6e |r->yPosi|tion.den|
|00004570| 6f 6d 69 6e 61 74 6f 72 | 20 3d 20 30 3b 0d 09 69 |ominator| = 0;..i|
|00004580| 64 50 74 72 2d 3e 66 72 | 65 65 4f 66 66 73 65 74 |dPtr->fr|eeOffset|
|00004590| 73 20 3d 20 6e 69 6c 3b | 0d 09 69 64 50 74 72 2d |s = nil;|..idPtr-|
|000045a0| 3e 66 72 65 65 42 79 74 | 65 43 6f 75 6e 74 73 20 |>freeByt|eCounts |
|000045b0| 3d 20 6e 69 6c 3b 0d 09 | 69 64 50 74 72 2d 3e 67 |= nil;..|idPtr->g|
|000045c0| 72 61 79 52 65 73 70 6f | 6e 73 65 55 6e 69 74 20 |rayRespo|nseUnit |
|000045d0| 3d 20 2d 31 3b 0d 09 69 | 64 50 74 72 2d 3e 67 72 |= -1;..i|dPtr->gr|
|000045e0| 61 79 52 65 73 70 6f 6e | 73 65 43 75 72 76 65 20 |ayRespon|seCurve |
|000045f0| 3d 20 6e 69 6c 3b 0d 09 | 69 64 50 74 72 2d 3e 67 |= nil;..|idPtr->g|
|00004600| 72 6f 75 70 33 4f 70 74 | 69 6f 6e 73 20 3d 20 30 |roup3Opt|ions = 0|
|00004610| 3b 0d 09 69 64 50 74 72 | 2d 3e 67 72 6f 75 70 34 |;..idPtr|->group4|
|00004620| 4f 70 74 69 6f 6e 73 20 | 3d 20 30 3b 0d 09 69 64 |Options |= 0;..id|
|00004630| 50 74 72 2d 3e 72 65 73 | 6f 6c 75 74 69 6f 6e 55 |Ptr->res|olutionU|
|00004640| 6e 69 74 20 3d 20 2d 31 | 3b 0d 09 69 64 50 74 72 |nit = -1|;..idPtr|
|00004650| 2d 3e 70 61 67 65 4e 75 | 6d 62 65 72 5b 30 5d 20 |->pageNu|mber[0] |
|00004660| 3d 20 30 3b 0d 09 69 64 | 50 74 72 2d 3e 70 61 67 |= 0;..id|Ptr->pag|
|00004670| 65 4e 75 6d 62 65 72 5b | 31 5d 20 3d 20 30 3b 0d |eNumber[|1] = 0;.|
|00004680| 09 69 64 50 74 72 2d 3e | 63 6f 6c 6f 72 52 65 73 |.idPtr->|colorRes|
|00004690| 70 6f 6e 73 65 55 6e 69 | 74 20 3d 20 2d 31 3b 0d |ponseUni|t = -1;.|
|000046a0| 09 69 64 50 74 72 2d 3e | 63 6f 6c 6f 72 52 65 73 |.idPtr->|colorRes|
|000046b0| 70 6f 6e 73 65 43 75 72 | 76 65 73 20 3d 20 6e 69 |ponseCur|ves = ni|
|000046c0| 6c 3b 0d 09 2a 2f 0d 7d | 0d 23 65 6e 64 69 66 00 |l;..*/.}|.#endif.|
|000046d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004700| 00 00 01 00 00 00 01 e0 | 00 00 00 e0 00 00 00 3e |........|.......>|
|00004710| 00 00 19 01 01 29 4e c8 | 00 18 53 86 00 06 00 00 |.....)N.|..S.....|
|00004720| 00 00 07 00 00 00 19 56 | 00 1f 30 1f 00 02 30 22 |.......V|..0...0"|
|00004730| 08 74 69 66 66 69 6f 2e | 63 00 02 00 00 00 50 61 |.tiffio.|c.....Pa|
|00004740| 72 74 53 49 54 78 00 00 | 00 00 00 00 00 00 00 01 |rtSITx..|........|
|00004750| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00004760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004770| 00 00 a9 80 21 31 00 00 | 00 00 00 00 02 1e 46 a6 |....!1..|......F.|
|00004780| 00 03 46 da 00 01 07 00 | 00 00 1a 36 00 14 47 05 |..F.....|...6..G.|
|00004790| 00 02 47 0e 00 01 47 1b | 00 01 07 00 00 00 1a 36 |..G...G.|.......6|
|000047a0| 00 18 47 1e 00 0f 47 32 | 00 16 47 4d 00 08 07 00 |..G...G2|..GM....|
|000047b0| 00 00 1a 36 00 45 47 58 | 00 16 47 74 00 06 47 7c |...6.EGX|..Gt..G||
|000047c0| 00 05 07 00 00 00 1a ac | 00 24 21 ad 00 05 21 b4 |........|.$!...!.|
|000047d0| 00 07 22 d8 00 01 07 00 | 00 00 1a ac 00 31 23 37 |..".....|.....1#7|
|000047e0| 00 01 23 39 00 02 23 3e | 00 01 07 00 00 00 1a ac |..#9..#>|........|
|000047f0| 00 35 23 40 00 07 00 00 | 00 00 00 00 00 00 07 00 |.5#@....|........|
|00004800| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 2a 2f 0d |...H..Mo|naco.*/.|
|00004810| 2f 2a 20 23 69 6e 63 6c | 75 64 65 20 22 45 72 72 |/* #incl|ude "Err|
|00004820| 4e 6f 2e 68 22 20 00 06 | 00 04 00 40 00 0c 01 4e |No.h" ..|...@...N|
|00004830| 01 f8 00 40 00 0c 01 4e | 01 f8 9d ec 24 42 00 00 |...@...N|....$B..|
|00004840| 06 2b 00 00 06 2b 00 00 | 05 b3 01 00 00 00 00 90 |.+...+..|........|
|00004850| 00 08 00 00 09 11 00 00 | 09 19 09 52 65 61 64 54 |........|...ReadT|
|00004860| 69 66 66 00 00 00 21 34 | 00 00 21 3d 09 57 72 69 |iff...!4|..!=.Wri|
|00004870| 74 65 54 69 66 66 00 00 | 31 2f 00 00 31 36 07 43 |teTiff..|1/..16.C|
|00004880| 6c 65 61 6e 55 70 00 00 | 33 a9 00 00 33 af 07 49 |leanUp..|3...3..I|
|00004890| 44 49 6e 69 74 00 00 00 | 38 a9 00 00 38 b4 0b 47 |DInit...|8...8..G|
|000048a0| 65 74 44 69 72 45 6e 74 | 72 79 00 00 3a 00 00 00 |etDirEnt|ry..:...|
|000048b0| 3a 08 09 54 79 70 65 53 | 69 7a 65 00 00 00 3a e8 |:..TypeS|ize...:.|
|000048c0| 00 00 3a f0 09 53 65 74 | 49 44 50 74 72 00 00 00 |..:..Set|IDPtr...|
|000048d0| 3e e4 00 00 3e ed 09 44 | 69 73 70 6c 61 79 49 44 |>...>..D|isplayID|
|000048e0| 00 00 01 00 00 00 01 e0 | 00 00 00 e0 00 00 00 3e |........|.......>|
|000048f0| 00 01 65 68 06 40 00 00 | 00 1c 00 3e 00 00 4d 50 |..eh.@..|...>..MP|
|00004900| 53 52 00 01 00 0a 03 ed | ff ff 00 00 00 00 00 00 |SR......|........|
|00004910| 00 00 03 ef ff ff 00 00 | 00 4c 00 02 66 be 00 00 |........|.L..f...|
|00004920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+